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

Abandoned → [wapmorgan/imagery](/?search=wapmorgan%2Fimagery)ArchivedLibrary[Image &amp; Media](/categories/media)

wapmorgan/image-editor
======================

Simple image editor for resizing, cropping and doing other elementary actions with images.

v0.0.7(9y ago)35261MITPHP

Since Apr 22Pushed 7y ago1 watchersCompare

[ Source](https://github.com/wapmorgan/ImageEditor)[ Packagist](https://packagist.org/packages/wapmorgan/image-editor)[ Docs](https://github.com/wapmorgan/ImageEditor)[ RSS](/packages/wapmorgan-image-editor/feed)WikiDiscussions master Synced 5d ago

READMEChangelog (6)DependenciesVersions (6)Used By (0)

**!! Moved to another repository: ****This one is not updatable at all!**

---

**ImageEditor** is a wrapper of gd functions. Earlier it was working only in yii-application context, now you can use this package in any application.

[![Composer package](https://camo.githubusercontent.com/fd5f27608427ff600078eb0fd408a2f8c4a057b2a7c6d681b4929e433c33930e/687474703a2f2f786e2d2d6531616469696a62676c2e786e2d2d70316163662f62616467652f7761706d6f7267616e2f696d6167652d656469746f72)](https://packagist.org/packages/wapmorgan/image-editor)[![Latest Stable Version](https://camo.githubusercontent.com/1b11e2508fe3ac8ea30149acb88a7fd0787e313c0bfb9b15f788ce672fefd167/68747470733a2f2f706f7365722e707567782e6f72672f7761706d6f7267616e2f696d6167652d656469746f722f762f737461626c65)](https://packagist.org/packages/wapmorgan/image-editor)[![Total Downloads](https://camo.githubusercontent.com/e3ac2916c7556ef77d555a3abdc3b36a371d66b839a9757cf81539e3d179ebb2/68747470733a2f2f706f7365722e707567782e6f72672f7761706d6f7267616e2f696d6167652d656469746f722f646f776e6c6f616473)](https://packagist.org/packages/wapmorgan/image-editor)[![License](https://camo.githubusercontent.com/590acba515a4411d0d1794f8fa436b0277de36740525bdf4dd6d0b53a0600a0e/68747470733a2f2f706f7365722e707567782e6f72672f7761706d6f7267616e2f696d6167652d656469746f722f6c6963656e7365)](https://packagist.org/packages/wapmorgan/image-editor)

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

[](#installation)

- Composer package: `wapmorgan/image-editor` \[[1](https://packagist.org/packages/wapmorgan/image-editor)\]
- Archive: `https://github.com/wapmorgan/ImageEditor/archive/master.zip`

**How to start**: Create from existing file or make an empty area

```
$image = ImageEditor::createFromFile($filename);
// or
$image = ImageEditor::createWithSize($width, $height);
// or
$image = ImageEditor::createFromResource(imagecreatetruecolor(90, 90));
```

Properties:
-----------

[](#properties)

1. **width** - width of image
2. **height** - height of image
3. **resource** - original gd-resource of image (you can pass it directly to image-gd functions)

Operations
----------

[](#operations)

### Resize &amp;&amp; Zoom (don't cut image)

[](#resize--zoom-dont-cut-image)

**can minimize and maximize image**:

1. **zoomWidthTo(int $size)** - changes proportionally image width to `$size`
2. **zoomHeightTo(int $size)** - changes proportionally image height to `$size`

**can only minimize image**:

1. **decreaseWidthTo(int $size)** - decreases proportionally image width to `$size`, if needed
2. **decreaseHeightTo(int $size)** - decreases proportionally image height to `$size`, if needed
3. **decreaseTo(int $size)** - decreases proportionally larger side to `$size`, if needed

**can do everything you ask it for**:

1. **resize(int $width, int $height)** - resizes an image to `$width` X `$height`

### Crop (can cut image)

[](#crop-can-cut-image)

1. **crop($x, $y, $x2, $y2)** - cuts a rectangular piece of image
2. **decreaseSide($side, int $size)** - deletes a piece of image from specific side. For example, if $side=top and $size=100, 100px from top will be deleted.

### Rotation &amp;&amp; Mirroring

[](#rotation--mirroring)

1. **rotate($angle, $bgColor = 0)** - rotates an image. `True` equals 90°, `False` equals -90°.
2. **horizontalFlip()** - flips an image horizontally.
3. **verticalFlip()** - flips an image vertically.

### Manipulation:

[](#manipulation)

1. **appendImageTo($side, ImageEditor $appendix, int $modifiers)** - appends an image (`$appendix`) to current image at `$side` (`top|bottom|left|right`).
2. **placeImageAt($x, $y, ImageEditor $image)** - places an image atop current image at `$x` X `$y`.
3. **placeImageAtCenter(ImageEditor $image)** - places an image in the center of current image.

### Save

[](#save)

1. **save($filename, $format, $quality)** - saves image to disk. Possible `$format` values: jpeg, png, gif, wbmp. Quality is an integer value between 0 (worst) and 100 (best).

### Links

[](#links)

- ImageEditor repo:
- ImageEditor testing script:
- ImageEditor docs:
- ImageEditor class reference (API):

### Changelog

[](#changelog)

```
+------------------------------------------------+--------------+------------------------------------------------------------------------------------------------------------------------+
| version                                        | date         | description                                                                                                            |
+------------------------------------------------+--------------+------------------------------------------------------------------------------------------------------------------------+
| v0.0.6: composer fixes and ImageEditor updates | May 19, 2014 | Changed:                                                                                                               |
|                                                |              | * Method **saveToFile()** marked as depricated. Now use **save()** method instead.                                     |
|                                                |              | * Added method **tryCreateFromFile()** which returns either an ImageEditor instance (on success) or null (on failure). |
|                                                |              | * Fixed composer configuration (autoloading and requirements).                                                         |
+------------------------------------------------+--------------+------------------------------------------------------------------------------------------------------------------------+
| v0.0.5: instantiation from bmp files           | May 6, 2014  | Changed:                                                                                                               |
|                                                |              | * Added function **imagecreatefrombmp**.                                                                               |
|                                                |              | * Some updates in `saveToFile()`: now you can use predefined constants like IMAGETYPE_XXX to specify output format.    |
+------------------------------------------------+--------------+------------------------------------------------------------------------------------------------------------------------+
| v0.0.4: new class ImageEditorTools             | Apr 22, 2014 | Changed:                                                                                                               |
|                                                |              | * Added **ImageEditorTools.php** with `pHash()` method.                                                                |
+------------------------------------------------+--------------+------------------------------------------------------------------------------------------------------------------------+
| v0.0.3: standalone using and composer.json     | Apr 22, 2014 | Changed:                                                                                                               |
|                                                |              | * Added **CComponent.php**. **ImageEditor** loads in automatically if need. (so you can use ImageEditor without yii).  |
|                                                |              | * Added **composer.json**. Packagist name: `wapmorgan/image-editor`                                                    |
+------------------------------------------------+--------------+------------------------------------------------------------------------------------------------------------------------+
| v0.0.2: a lot of changes                       | Apr 12, 2014 | Changed:                                                                                                               |
|                                                |              | * allowing clone object.                                                                                               |
|                                                |              | * returning $this in all methods.                                                                                      |
|                                                |              | * **cropSide** renamed to **decreaseSide**.                                                                            |
|                                                |              | * added **decreaseWidthTo**(), **decreaseHeightTo**() and **decreaseTo**().                                            |
|                                                |              | * **appendImageTo**() finished.                                                                                        |
|                                                |              | * **rotate()** fixed.                                                                                                  |
|                                                |              | * **added gif and wbmp** formats in saveToFile().                                                                      |
|                                                |              | * **added mirroring functions**: horizontalFlip() and verticalFlip().                                                  |
|                                                |              | * **added createFromResource** static public method.                                                                   |
|                                                |              | * **created testing script**, **added docs**.                                                                          |
+------------------------------------------------+--------------+------------------------------------------------------------------------------------------------------------------------+
| first commit                                   | Oct 4, 2013  |                                                                                                                        |
+------------------------------------------------+--------------+------------------------------------------------------------------------------------------------------------------------+

```

###  Health Score

29

—

LowBetter than 59% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity57

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 96.4% 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 ~249 days

Total

5

Last Release

3413d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/6000618?v=4)[Sergey](/maintainers/wapmorgan)[@wapmorgan](https://github.com/wapmorgan)

---

Top Contributors

[![wapmorgan](https://avatars.githubusercontent.com/u/6000618?v=4)](https://github.com/wapmorgan "wapmorgan (27 commits)")[![dmitlantis](https://avatars.githubusercontent.com/u/1695091?v=4)](https://github.com/dmitlantis "dmitlantis (1 commits)")

---

Tags

images

### Embed Badge

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

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

###  Alternatives

[rosell-dk/webp-convert

Convert JPEG &amp; PNG to WebP with PHP

6038.1M54](/packages/rosell-dk-webp-convert)[jbzoo/image

A PHP class that simplifies working with images

171126.9k3](/packages/jbzoo-image)[mindkomm/timmy

Advanced image manipulation for Timber.

17735.6k](/packages/mindkomm-timmy)[wp-media/imagify-plugin

Image optimization plugin for WordPress by WP Media.

7960.9k](/packages/wp-media-imagify-plugin)[spatie/pixelmatch-php

Compare images using PHP

5783.7k9](/packages/spatie-pixelmatch-php)[andrewgjohnson/imagettftextblur

imagettftextblur is a drop in replacement for imagettftext with added parameters to add blur, glow and shadow effects to your PHP GD images

27198.4k1](/packages/andrewgjohnson-imagettftextblur)

PHPackages © 2026

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