PHPackages                             wapmorgan/imagery - 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/imagery

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

wapmorgan/imagery
=================

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

1.0.1(9y ago)251734MITPHP

Since Jan 11Pushed 8y ago8 watchersCompare

[ Source](https://github.com/wapmorgan/Imagery)[ Packagist](https://packagist.org/packages/wapmorgan/imagery)[ RSS](/packages/wapmorgan-imagery/feed)WikiDiscussions master Synced 2mo ago

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

Imagery simplifies image manipulations.
---------------------------------------

[](#imagery-simplifies-image-manipulations)

*Imagery* supports:

- resizing
- cropping
- flipping and rotating
- making collages
- applying filters and effects

[![Composer package](https://camo.githubusercontent.com/a87d65394383c503fd46bb7735b55cd0c7b3da5bbf0faed99b93e68001330d60/687474703a2f2f636f6d706f7365722e6e6574776f726b2f62616467652f7761706d6f7267616e2f696d6167657279)](https://packagist.org/packages/wapmorgan/imagery)[![Latest Stable Version](https://camo.githubusercontent.com/c3ff59ed27108824bc5a7f1b395e87617a78ad5b702eb0b2af976f7e00760000/68747470733a2f2f706f7365722e707567782e6f72672f7761706d6f7267616e2f696d61676572792f762f737461626c65)](https://packagist.org/packages/wapmorgan/imagery)[![Total Downloads](https://camo.githubusercontent.com/45c1d7a4f25f1516e5268be482bd5fbe2f912c3b5fefdc02ae4e661e677dfa2e/68747470733a2f2f706f7365722e707567782e6f72672f7761706d6f7267616e2f696d61676572792f646f776e6c6f616473)](https://packagist.org/packages/wapmorgan/imagery)[![License](https://camo.githubusercontent.com/2dfb6fae36ab87d006894c27af24f2849143b8944be611d7e1cbde78f319c813/68747470733a2f2f706f7365722e707567782e6f72672f7761706d6f7267616e2f696d61676572792f6c6963656e7365)](https://packagist.org/packages/wapmorgan/imagery)

1. **Installation**
2. **API**

Installation
============

[](#installation)

- Composer package:

```
  composer require wapmorgan/imagery

```

API
===

[](#api)

Imagery
-------

[](#imagery)

```
use Imagery\Imagery;
```

### Opening

[](#opening)

Create new Imagery object:

- `$image = Imagery::open($filename);` - from a file.
- `$image = Imagery::create($width, $height);` - new image
- `$image = new Imagery(imagecreatefrombmp('image.bmp'));` - from a resource

### Saving

[](#saving)

- `public function save($filename, $quality = 75, $format = null)` - saves image to disk. Quality is an integer value between `0` (worst) and `100` (best). Default is `75`. Quality is applicable only to JPEG, PNG, WEBP. If `$format` can not be determined by filename extension, specifcy it explicitly.

Formats supports:

OperationFormatsOpeningjpeg, png, gif, bmp, wbmp, xbm, xpm, webp (php &gt;= 7.1.0)Savingjpeg, png, gif, bmp, wbmp, xbm, webp (php &gt;= 7.1.0)### Properties

[](#properties)

- `$image->width` - width of image
- `$image->height` - height of image
- `$image->resource` - original gd-resource of image (you can use it with gd-functions)

### Resize &amp;&amp; Zoom

[](#resize--zoom)

- `public function resize(int $width, int $height)` - resizes an image to `$width` X `$height`
- `public function zoomWidthTo(int $size)` - changes proportionally image width to `$size`
- `public function zoomHeightTo(int $size)` - changes proportionally image height to `$size`
- `public function zoomMaxSide(int $size)` - zoomes proportionally larger side to `$size`, if needed

### Crop

[](#crop)

- `public function crop($x, $y, $x2, $y2)` - cuts a rectangular piece of image
- `public function 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)

- `public function rotate($angle, $bgColor = 0)` - rotates an image. `True` equals 90°, `False` equals -90°.
- `public function flip($horizontally = true)` - flips an image horizontally or vertically.

### Collage

[](#collage)

- `public function appendImageTo($side, Imagery $appendix, int $modifiers)` - appends an image (`$appendix`) to current image at `$side` (`top|bottom|left|right`). Modifiers:

    - `Imagery::ZOOM_IF_LARGER` - appendix' height will be zoomed (not resized) if it's larger than current image's one (when appending to left or right side); appendix' width will be zoomed (not resized) if it's larger than current image's one (when appending to top or bottom side);
- `public function placeImageAt($x, $y, Imagery $image)` - places an image atop current image at `$x` X `$y`.
- `public function placeImageAtCenter(Imagery $image)` - places an image in the center of current image.

### Effects

[](#effects)

- `public function filter($filter)` - applies grayscale or negate filter. Pass `Imagery::FILTER_NEGATE` or `Imagery::FILTER_GRAYSCALE` as $filter.

    Grayscale:

    [![Original](https://github.com/wapmorgan/Imagery/releases/download/1.0.0/original.png)](https://github.com/wapmorgan/Imagery/releases/download/1.0.0/original.png)-&gt; [![Grayscale](https://github.com/wapmorgan/Imagery/releases/download/1.0.0/grayscale_original.png)](https://github.com/wapmorgan/Imagery/releases/download/1.0.0/grayscale_original.png)

    Negate:

    [![Original](https://github.com/wapmorgan/Imagery/releases/download/1.0.0/original.png)](https://github.com/wapmorgan/Imagery/releases/download/1.0.0/original.png)-&gt; [![Negate](https://github.com/wapmorgan/Imagery/releases/download/1.0.0/negate_original.png)](https://github.com/wapmorgan/Imagery/releases/download/1.0.0/negate_original.png)
- `public function changeContrast($newValue)` - changes contrast of image. New values can be in range from 100 (max contrast) to -100 (min contrast), 0 means no change.

    [![Original](https://github.com/wapmorgan/Imagery/releases/download/1.0.0/original.png)](https://github.com/wapmorgan/Imagery/releases/download/1.0.0/original.png)-&gt; [![Negate](https://github.com/wapmorgan/Imagery/releases/download/1.0.0/contrast_original.png)](https://github.com/wapmorgan/Imagery/releases/download/1.0.0/contrast_original.png)
- `public function changeBrightness($newValue)` - changes brightness of image. New values can be in range from 255 (max brightness) to -255 (min brightness), 0 means no change.

    [![Original](https://github.com/wapmorgan/Imagery/releases/download/1.0.0/original.png)](https://github.com/wapmorgan/Imagery/releases/download/1.0.0/original.png)-&gt; [![Negate](https://github.com/wapmorgan/Imagery/releases/download/1.0.0/brightness_original.png)](https://github.com/wapmorgan/Imagery/releases/download/1.0.0/brightness_original.png)
- `public function colorize($red, $green, $blue, $alpha = 127)` - changes colors of image. Colors (`$red, $green, $blue`) can be in range from 255 to -255. `$alpha` from 127 to 0.

    [![Original](https://github.com/wapmorgan/Imagery/releases/download/1.0.0/original.png)](https://github.com/wapmorgan/Imagery/releases/download/1.0.0/original.png)-&gt; [![Negate](https://github.com/wapmorgan/Imagery/releases/download/1.0.0/colorize_original.png)](https://github.com/wapmorgan/Imagery/releases/download/1.0.0/colorize_original.png)
- `public function blur($method)` - blurs an image. Method can be `Imagery::GAUSSIAN_BLUR` or `Imagery::SELECTIVE_BLUR`.

    [![Original](https://github.com/wapmorgan/Imagery/releases/download/1.0.0/original.png)](https://github.com/wapmorgan/Imagery/releases/download/1.0.0/original.png)-&gt; [![Negate](https://github.com/wapmorgan/Imagery/releases/download/1.0.0/blur_original.png)](https://github.com/wapmorgan/Imagery/releases/download/1.0.0/blur_original.png)
- `public function smooth($level)` - smooths an image. Level of smoothness can be in range from 0 to 8. 8 is un-smooth.

    [![Original](https://github.com/wapmorgan/Imagery/releases/download/1.0.0/original.png)](https://github.com/wapmorgan/Imagery/releases/download/1.0.0/original.png)-&gt; [![Negate](https://github.com/wapmorgan/Imagery/releases/download/1.0.0/smooth_original.png)](https://github.com/wapmorgan/Imagery/releases/download/1.0.0/smooth_original.png)
- `public function pixelate($blockSize = 5, $useModernEffect = true)` - pixelates an image. `$blockSize` is size of pixel block.

    [![Original](https://github.com/wapmorgan/Imagery/releases/download/1.0.0/original.png)](https://github.com/wapmorgan/Imagery/releases/download/1.0.0/original.png)-&gt; [![Negate](https://github.com/wapmorgan/Imagery/releases/download/1.0.0/pixelate_original.png)](https://github.com/wapmorgan/Imagery/releases/download/1.0.0/pixelate_original.png)

Tools
-----

[](#tools)

There's a tools class: `Imagery/Tools`.

- `static public function pHash(Imagery $image, $sizes = array(8, 8))`

    Calculates Perceptual hash of image.

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity22

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity64

Established project with proven stability

 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

Every ~112 days

Total

2

Last Release

3297d 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 (21 commits)")

---

Tags

image-processingimagesphash

### Embed Badge

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

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

###  Alternatives

[jenssegers/imagehash

Perceptual image hashing for PHP

2.1k2.2M5](/packages/jenssegers-imagehash)[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)

PHPackages © 2026

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