PHPackages                             dantsu/php-image-editor - 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. dantsu/php-image-editor

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

dantsu/php-image-editor
=======================

PHP library to easily edit image with GD extension.

1.4.5(2y ago)34167.0k↓65%14[2 PRs](https://github.com/DantSu/php-image-editor/pulls)2MITPHPPHP &gt;=7.0

Since Sep 8Pushed 2y ago1 watchersCompare

[ Source](https://github.com/DantSu/php-image-editor)[ Packagist](https://packagist.org/packages/dantsu/php-image-editor)[ Docs](https://github.com/DantSu/php-image-editor)[ GitHub Sponsors](https://github.com/DantSu)[ RSS](/packages/dantsu-php-image-editor/feed)WikiDiscussions master Synced 1w ago

READMEChangelog (10)DependenciesVersions (16)Used By (2)

[![Packagist](https://camo.githubusercontent.com/da53f3e2073f53b0d7f4be6851b4506b0053e1e4e42946f23c8aba36f57127c4/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f44616e7453752f7068702d696d6167652d656469746f722e737667)](https://packagist.org/packages/DantSu/php-image-editor)[![Latest Stable Version](https://camo.githubusercontent.com/76cd375a8060f1721bf56b1d4929d72bf647245d74d63a5e8948acd1f3746ed4/68747470733a2f2f706f7365722e707567782e6f72672f44616e7453752f7068702d696d6167652d656469746f722f762f737461626c65)](https://packagist.org/packages/DantSu/php-image-editor)[![GitHub license](https://camo.githubusercontent.com/ed41d04b5e71c7d9d410da63c9397a949b507ccaca22e4f09febc74a8dbabebb/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f44616e7453752f7068702d696d6167652d656469746f722e737667)](https://github.com/DantSu/php-image-editor/blob/master/LICENSE)

PHP Image Editor
================

[](#php-image-editor)

PHP library to easily edit image with GD extension. Resize, crop, merge, draw, and many more options !

✨ Supporting
------------

[](#-supporting)

⭐ Star this repository to support this project. You will contribute to increase the visibility of this library 🙂

Installation
------------

[](#installation)

Install this library easily with composer :

```
composer require dantsu/php-image-editor
```

How to use
----------

[](#how-to-use)

### Example 1

[](#example-1)

Create a empty image, draw on it and display it :

```
use \DantSu\PHPImageEditor\Image;

\header('Content-type: image/png');

$image = Image::newCanvas(500, 500)
    ->drawRectangle(0, 0, 500, 500, '#444')
    ->drawRectangle(0, 350, 500, 500, '#FF8800')
    ->writeText('I got the power !', __DIR__ . '/resources/font.ttf', 40, '#FFFFFF', Image::ALIGN_CENTER, 310)
    ->drawCircle(25, 100, 100, '#FF8800')
    ->drawCircle(25, 100, 95, '#000000FF')
    ->drawCircle(475, 100, 100, '#FF8800')
    ->drawCircle(475, 100, 95, '#000000FF');

for($i = 0; $i drawArrowWithAngle(250, 200, $i, 80, 2, '#FF8800')
        ->drawArrowWithAngle(250, 200, ($i + 15), 50, 2, '#FF8800');
}

$image
    ->crop(450, 300, Image::ALIGN_CENTER, Image::ALIGN_MIDDLE)
    ->displayPNG();
```

[![Sample 1](./src/samples/resources/sample1.png)](./src/samples/resources/sample1.png)

### Example 2

[](#example-2)

Apply a watermark on a photo and save it :

```
use \DantSu\PHPImageEditor\Image;

Image::fromPath(__DIR__ . '/resources/photo.jpg')
    ->downscaleAndCrop(1920, 1080, Image::ALIGN_CENTER, Image::ALIGN_BOTTOM)
    ->pasteOn(
        Image::fromPath(__DIR__ . '/resources/watermark.png')->downscaleProportion(300, 300),
        Image::ALIGN_RIGHT,
        Image::ALIGN_TOP
    )
    ->saveJPG(__DIR__ . '/my-image.jpg', 70);
```

[![Sample 2](./src/samples/resources/sample2.jpg)](./src/samples/resources/sample2.jpg)

Documentation
-------------

[](#documentation)

See [DantSu\\PHPImageEditor\\Image](./docs/classes/DantSu/PHPImageEditor/Image.md) documentation class for more details.

Contributing
------------

[](#contributing)

Please fork this repository and contribute back using pull requests.

Any contributions, large or small, major features, bug fixes, are welcomed and appreciated but will be thoroughly reviewed.

###  Health Score

38

—

LowBetter than 83% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity46

Moderate usage in the ecosystem

Community20

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 90.7% 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

Every ~51 days

Recently: every ~22 days

Total

15

Last Release

1021d ago

PHP version history (2 changes)1.0.0PHP ^7.0

1.0.4PHP &gt;=7.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/4188774?v=4)[Franck Alary](/maintainers/DantSu)[@DantSu](https://github.com/DantSu)

---

Top Contributors

[![DantSu](https://avatars.githubusercontent.com/u/4188774?v=4)](https://github.com/DantSu "DantSu (39 commits)")[![roelofjan-elsinga](https://avatars.githubusercontent.com/u/9220754?v=4)](https://github.com/roelofjan-elsinga "roelofjan-elsinga (2 commits)")[![daurensky](https://avatars.githubusercontent.com/u/58464833?v=4)](https://github.com/daurensky "daurensky (1 commits)")[![davetha](https://avatars.githubusercontent.com/u/8431567?v=4)](https://github.com/davetha "davetha (1 commits)")

---

Tags

composercomposer-librarycomposer-packagegdimageimage-editingimage-editorimage-manipulationphpphp-libraryphp7phpimageeditorphotopictureeditGD2edition

### Embed Badge

![Health badge](/badges/dantsu-php-image-editor/health.svg)

```
[![Health](https://phpackages.com/badges/dantsu-php-image-editor/health.svg)](https://phpackages.com/packages/dantsu-php-image-editor)
```

###  Alternatives

[toinekamps/responsive-pics

Responsive Pics is a Wordpress tool for resizing images on the fly.

832.2k](/packages/toinekamps-responsive-pics)

PHPackages © 2026

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