PHPackages                             dnsimmons/imager - 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. dnsimmons/imager

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

dnsimmons/imager
================

Imager is a Laravel package simplifying image processing operations using PHP's native GD library extension

2.0.0(5y ago)1960LGPL-3.0PHP

Since Jun 7Pushed 5y ago1 watchersCompare

[ Source](https://github.com/dnsimmons/imager)[ Packagist](https://packagist.org/packages/dnsimmons/imager)[ RSS](/packages/dnsimmons-imager/feed)WikiDiscussions master Synced yesterday

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

Imager
======

[](#imager)

[![Latest Stable Version](https://camo.githubusercontent.com/4450c9c764eaff69fea1f0e17bb67ab9425f2ce11ed460d6ddac51372a6bf4c2/68747470733a2f2f706f7365722e707567782e6f72672f646e73696d6d6f6e732f696d616765722f76)](//packagist.org/packages/dnsimmons/imager)[![Latest Unstable Version](https://camo.githubusercontent.com/7360efe53bba9c0477f32ca76a8b7d516ad0a03bb9e1b345e875b38b070776de/68747470733a2f2f706f7365722e707567782e6f72672f646e73696d6d6f6e732f696d616765722f762f756e737461626c65)](//packagist.org/packages/dnsimmons/imager)[![Total Downloads](https://camo.githubusercontent.com/fa21277657488e24d12575c67ed872179672c5db48d157cccbe4ea7ca43b06a7/68747470733a2f2f706f7365722e707567782e6f72672f646e73696d6d6f6e732f696d616765722f646f776e6c6f616473)](//packagist.org/packages/dnsimmons/imager)[![License](https://camo.githubusercontent.com/e29e1ec159a489d8e39f824056760942e63a6807a001627fff6d1dade84b8d07/68747470733a2f2f706f7365722e707567782e6f72672f646e73696d6d6f6e732f696d616765722f6c6963656e7365)](//packagist.org/packages/dnsimmons/imager)

About Imager
------------

[](#about-imager)

Imager is a [Laravel](http://laravel.com) package simplifying image processing operations using PHP's native GD library extension.

Install
-------

[](#install)

Use [composer](http://getcomposer.org) to install the package

```
composer require dnsimmons/imager

```

Add the service provider to your config/app.php along with an alias:

```
'providers' => [
	...
    Dnsimmons\Imager\ImagerServiceProvider::class,
];

'aliases' => [
	...
    'Imager' => Dnsimmons\Imager\Imager::class,
];

```

Usage
-----

[](#usage)

### Basic Usage

[](#basic-usage)

The basic example provided below takes an input file example.jpg and resizes it to 640 x 480 pixels and then converts it to greyscale before outputting the raw image data to the browser.

**Basic Example**

```
$imager = new \Imager('path/to/example.jpg');
$imager->resize(640,480)->greyscale()->render();

```

Most of the examples provided in this documentation uses a call to `render()` which will output the image as raw data back to the caller. In the event you wish to write images to disk simply use `write()` and specify the path and filename for the output.

**Render Example**

```
$imager = new \Imager('path/to/example.jpg');
$imager->resize(640,480)->greyscale()->render();

```

**Write Example**

```
$imager = new \Imager('path/to/example.jpg');
$imager->resize(640,480)->greyscale()->write('path/to/output.jpg');

```

### Using Scripts

[](#using-scripts)

Imager also supports scripted processing using JSON. Let's repeat what we did above but instead deliver it as a script.

**Scripted Example**

```
$imager = new \Imager('path/to/example.jpg');
$imager->script('path/to/script.json')->render();

```

Here is our example commands script (script.json). Parameters are supplied in the same order as required by the actual methods for a given command.

```
[
	{"command":"resize", "params":["640","480"]},
	{"command":"greyscale", "params":[]}
]

```

Commands (A-Z)
--------------

[](#commands-a-z)

**anaglyph**( )

Applys a stereo 3D anaglyph effect to an image.

```
$imager->anaglyph()->render();

```

**blackwhite**( )

Converts an images color to black and white.

```
$imager->blackwhite()->render();

```

**blur**( *integer $level* )

Blurs an image with a given level from 0 to 10.

```
$imager->blur(1)->render();

```

**brightness**( *integer $level* )

Adjust the brightness of an image with a given level from -100 to 100.

```
$imager->brightness(50)->render();

```

**colorize**( *integer $r, integer $g, integer $b* )

Apply a color mask to an image with given RGB values from -255 to 255.

```
$imager->colorize(128,0,255)->render();

```

**convert**( *string $format* )

Convert an image to a specified image format (JPEG, PNG, or GIF).

```
$imager->convert('JPEG')->render();

```

**contrast**( *integer $level* )

Adjust the contrast of an image with a given level from -100 to 100.

```
$imager->contrast(50)->render();

```

**crop**( *integer $x, integer $y, integer $width, integer $height* )

Crops an image with specified width and height in pixels from a given x and y origin point.

```
$imager->crop(0,0,320,240)->render();

```

**desaturate**( *integer $level* )

Adjust the saturation of an image with a given level of 0 to 100.

```
$imager->desaturate(50)->render();

```

**emboss**( )

Apply a emboss filter to an image.

```
$imager->emboss()->render();

```

**fisheye**( )

Applys a fisheye lens effect to an image.

```
$imager->fisheye()->render();

```

**flip**( *string $direction* )

Flips an image either horizontally (h), vertically (v), or both directions (b).

```
$imager->flip('b')->render();

```

**greyscale**( )

Converts an images color to greyscale.

```
$imager->greyscale()->render();

```

**layer**( *string $image\_path, integer $opacity* )

Layers an image with a given opacity (from 0 to 100) on top of an image using identical dimensions.

```
$imager->layer('path/to/layer.png', 50)->render();

```

**negative**( )

Apply a negative filter to an image.

```
$imager->negative()->render();

```

**noise**( *integer $level* )

Adds noise to an image with a given noise level from 0 to ?.

```
$imager->noise(20)->render();

```

**pixelate**( *integer $size* )

Apply a pixelation filter to an image with a given pixel size.

```
$imager->pixelate(4)->render();

```

**replace**( integer $r, integer $g, integer $b, integer $r2, integer $g2, integer $b2 )

Apply a color replacement to an image with given RGB values from -255 to 255.

```
$imager->replace(255,0,0,0,0,255)->render();

```

**resize**( *integer $width, integer $height* )

Resizes an image to specified width and height in pixels.

```
$imager->resize(640,480)->render();

```

**rotate**( *integer $degrees* )

Rotates an image by a given number of degrees.

```
$imager->rotate(90)->render();

```

**scale**( *integer $width, integer $height* )

Scales an image to specified width and height in pixels based on largest dimension keeping aspect ratio.

```
$imager->scale(640,480)->render();

```

**sepia**( )

Apply a sepia filter to an image.

```
$imager->sepia()->render();

```

**sharpen**( *integer $level* )

Sharpens an image with a given level from 0 to 10.

```
$imager->sharpen(1)->render();

```

**sketch**( )

Apply a sketch filter to an image.

```
$imager->sketch()->render();

```

**smooth**( *integer $level* )

Smooths an image with a given level from 0 to 100.

```
$imager->smooth(10)->render();

```

**vignette**( *integer $size* )

Applys a vignette effect to an image with a given size of 0 to 10.

```
$imager->vignette(0.4)->render();

```

**watermark**( *string $image\_path, string $position* )

Applys an image in a given position on top of an image. Possible positions include center, top-left, top-right, bottom-left, and bottom-right.

```
$imager->watermark('path/to/watermark.png', 'bottom-right')->render();

```

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity56

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

2166d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/b1dd284e694146506872d70d30fc535eea06cbf336307bdf895ce13e31c9e43a?d=identicon)[dnsimmons](/maintainers/dnsimmons)

---

Top Contributors

[![dnsimmons](https://avatars.githubusercontent.com/u/11092875?v=4)](https://github.com/dnsimmons "dnsimmons (34 commits)")

---

Tags

gdimage-manipulationimage-processinglaravelphp

### Embed Badge

![Health badge](/badges/dnsimmons-imager/health.svg)

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

###  Alternatives

[milon/barcode

Barcode generator like Qr Code, PDF417, C39, C39+, C39E, C39E+, C93, S25, S25+, I25, I25+, C128, C128A, C128B, C128C, 2-Digits UPC-Based Extention, 5-Digits UPC-Based Extention, EAN 8, EAN 13, UPC-A, UPC-E, MSI (Variation of Plessey code)

1.5k13.3M39](/packages/milon-barcode)[bkwld/croppa

Image thumbnail creation through specially formatted URLs for Laravel

510496.0k23](/packages/bkwld-croppa)[char0n/ffmpeg-php

PHP wrapper for FFmpeg application

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

Generates SVG graphs

132849.6k3](/packages/goat1000-svggraph)[cohensive/embed

Media Embed (for Laravel or as a standalone).

120370.4k](/packages/cohensive-embed)[netresearch/rte-ckeditor-image

Image support in CKEditor for the TYPO3 ecosystem - by Netresearch

63991.3k4](/packages/netresearch-rte-ckeditor-image)

PHPackages © 2026

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