PHPackages                             leongrdic/imgman - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Image &amp; Media](/categories/media)
4. /
5. leongrdic/imgman

ActiveLibrary[Image &amp; Media](/categories/media)

leongrdic/imgman
================

simple php image manipulator that can downscale and compress e.g. thumbnails and profile pictures

1.0.0(4y ago)890MITPHP

Since Jan 26Pushed 3y ago1 watchersCompare

[ Source](https://github.com/leongrdic/php-imgman)[ Packagist](https://packagist.org/packages/leongrdic/imgman)[ Docs](https://github.com/leongrdic/php-imgman)[ RSS](/packages/leongrdic-imgman/feed)WikiDiscussions master Synced today

READMEChangelog (1)DependenciesVersions (2)Used By (0)

imgman
======

[](#imgman)

This library uses GD and EXIF (optional) PHP extensions so make sure you have them installed.

It also uses the latest PHP 8.1 features and backwards compatibility isn't yet supported.

Install:
--------

[](#install)

```
composer require leongrdic/imgman

```

```
use \Le\ImgMan\{ImgMan, ImageFormat};
```

Supported formats
-----------------

[](#supported-formats)

### Input

[](#input)

- any image format supported by php-gd

Input methods: `fromDataUrl()`, `fromString()`, `fromFile()`

### Output

[](#output)

Call the `output()` method with the wanted output format:

- `ImageFormat::jpeg`
- `ImageFormat::png`
- `ImageFormat::webp` (make sure your php-gd is configured to work with webp)

After that use: `toDataUrl()`, `toString()`, `toFile()`

Example usages
--------------

[](#example-usages)

```
$rawImageBytes = (new ImgMan)
    ->fromDataUrl($dataUrlFromJS)
    ->cacheExif()
    ->downscale(2048)
    ->rotateFromExif() // rotating after downscaling should use less memory and be a bit faster
    ->output(ImageFormat::jpeg, quality: 75)
    ->toString();
```

```
(new ImgMan)
    ->fromFile('example.png')
    ->downscale(1920, 1080)
    ->output(ImageFormat::png)
    ->toFile(); // use input filename (replace original file)
```

```
$dataUrl = (new ImgMan)
    ->fromString($rawImageBytes)
    ->output(ImageFormat::webp, quality: 80)
    ->toDataUrl();
```

Notice
======

[](#notice)

This library hasn't yet been fully tested and is to be used at your own responsibility. Any feedback and improvement suggestions are appreciated!

###  Health Score

25

—

LowBetter than 35% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity49

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

1618d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/6260068?v=4)[Leon](/maintainers/leongrdic)[@leongrdic](https://github.com/leongrdic)

---

Top Contributors

[![leongrdic](https://avatars.githubusercontent.com/u/6260068?v=4)](https://github.com/leongrdic "leongrdic (5 commits)")

---

Tags

compress-imagesimage-processingphpphp-gdphp8thumbnail

### Embed Badge

![Health badge](/badges/leongrdic-imgman/health.svg)

```
[![Health](https://phpackages.com/badges/leongrdic-imgman/health.svg)](https://phpackages.com/packages/leongrdic-imgman)
```

###  Alternatives

[char0n/ffmpeg-php

PHP wrapper for FFmpeg application

495240.6k1](/packages/char0n-ffmpeg-php)[goat1000/svggraph

Generates SVG graphs

135911.1k3](/packages/goat1000-svggraph)[gravatarphp/gravatar

Gravatar URL builder which is most commonly called as a Gravatar library

16653.6k2](/packages/gravatarphp-gravatar)[rsoury/wp-imgix

Rewrites WordPress image URLs to use ImgIX

167.2k](/packages/rsoury-wp-imgix)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
