PHPackages                             jackal/image-merge - 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. jackal/image-merge

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

jackal/image-merge
==================

A simple PHP libraty to manipulate images

v0.4.5(6y ago)36861MITPHPPHP &gt;=5.6CI failing

Since Mar 8Pushed 6y ago3 watchersCompare

[ Source](https://github.com/lucajackal85/ImageMerge)[ Packagist](https://packagist.org/packages/jackal/image-merge)[ RSS](/packages/jackal-image-merge/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (8)Dependencies (6)Versions (13)Used By (0)

Image Merge
===========

[](#image-merge)

A simple PHP libraty to manipulate images, it support GIF, PNG and JPG

[![Latest Stable Version](https://camo.githubusercontent.com/c8e3a2644e0e9c2768486a1387875c2f5fa1f2344c5914a807dc4eb9868b10d5/68747470733a2f2f706f7365722e707567782e6f72672f6a61636b616c2f696d6167652d6d657267652f762f737461626c65)](https://packagist.org/packages/jackal/image-merge)[![Total Downloads](https://camo.githubusercontent.com/14b2757724f6431bb69f07747c447c1d06ff6e9931b88e914364002a6571d379/68747470733a2f2f706f7365722e707567782e6f72672f6a61636b616c2f696d6167652d6d657267652f646f776e6c6f616473)](https://packagist.org/packages/jackal/image-merge)[![Latest Unstable Version](https://camo.githubusercontent.com/ddd13229ba2251b13ae9d65bdf3510ad72d5339f5fe348102d0e74e1a0cd2d92/68747470733a2f2f706f7365722e707567782e6f72672f6a61636b616c2f696d6167652d6d657267652f762f756e737461626c65)](https://packagist.org/packages/jackal/image-merge)[![License](https://camo.githubusercontent.com/177e6beb9d9d4afabf5afb65e664eda002b40116af9b1949870314edb8ea539d/68747470733a2f2f706f7365722e707567782e6f72672f6a61636b616c2f696d6167652d6d657267652f6c6963656e7365)](https://packagist.org/packages/jackal/image-merge)[![Build Status](https://camo.githubusercontent.com/5b56e88b81c0f65efd8e9f1c2b7a76f300300a133aa0d4795b20ea05242da781/68747470733a2f2f7472617669732d63692e6f72672f6c7563616a61636b616c38352f42696e4c6f6361746f722e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/lucajackal85/BinLocator)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/cd727ec4c107ea976857081199764c35e5d696e1959d67dfa61aa8545a45e042/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6c7563616a61636b616c38352f496d6167654d657267652f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/lucajackal85/ImageMerge/?branch=master)

### Requirement

[](#requirement)

PHP &gt;= **5.6** with GD support \*For some additional features (for example image distortion) ImageMagick binaries are required.

Getting Started
---------------

[](#getting-started)

Install library with composer

```
composer require jackal/image-merge

```

Usage
-----

[](#usage)

### Minimal example

[](#minimal-example)

```

$imageMerge = new ImageMerge();
$imageBuilder = $imageMerge->getBuilder('/path/to/my/file.png'); #or URL, or resource, or binary content

$imageBuilder->resize(620,350)
$imageBuilder->rotate(90);

```

Get the image content directly to the output

```
[...]
echo $imageBuilder->getImage()->toPNG()->getContent();

```

Save image to path

```
[...]
$builder->getImage()->toPNG('/path/to/the/image.png');

```

Get image Response object (Compatible with Symgony projects)

```
[...]
return $imageBuilder->getImage()->toPNG()

```

#### `resize`

[](#resize)

At least one parameter is required In case just one parameter is passed, it will resize maintaining the aspect ratio of the image

```
$imageBuilder->resize(620,null);
#or
$imageBuilder->resize(null,200);

```

If both parameters are passed, it could stretch the image

```
$imageBuilder->resize(400,200);

```

#### `thumbnail`

[](#thumbnail)

Similar to `Resize` but in case the aspect ratio is not respected, it will crop the image (using `cropCenter`)

```
$imageBuilder->thumbnail(400,400);

```

#### `rotate`

[](#rotate)

Rotate the image (**counterclockwise**)

```
$imageBuilder->rotate(180);

```

\*In case of particular angle (30, 45, etc..) it will create blank area to fill the empty spaces

#### `grayscale`

[](#grayscale)

Add a graysclae filter to the image

```
$imageBuilder->grayScale();

```

#### `brightness`

[](#brightness)

Adjusts the brightness of the image

```
$imageBuilder->brightness(10);

```

#### `blur`

[](#blur)

Adds blur effect on the image

```
$imageBuilder->blur(20);

```

#### `pixelate`

[](#pixelate)

Adds "Pixel" effect on the image

```
$imageBuilder->pixelate(20);

```

#### `crop` and `cropCenter`

[](#crop-and-cropcenter)

**Crop**Crop the image according to the *x* and *y* coords and the output dimention passed

```
$point_x = 10,
$point_y = 15;
$width = 50,
$height = 50;
$imageBuilder->crop($point_x,$point_y,$width,$height);

```

Crop at the center of the image according to the width and height of the output image

```
$width = 50,
$height = 50;
$imageBuilder->cropCenter($point_x,$point_y,$width,$height);

```

#### `border`

[](#border)

It adds border to the image (fill inside the rect)

```
$stroke = 20;
$colorHex = '3399ff';
$builder->border($stroke,$colorHex);

```

### Experimental features that will likely change in the future

[](#experimental-features-that-will-likely-change-in-the-future)

#### `addText`

[](#addtext)

It adds text inside the image

```
$text = new Jackal\ImageMerge\Model\Text\Text('this is the text', Font::arial(), 12, new Color('ABCDEF'));
$builder->addText($text, 10, 20);

```

#### `addSquare`

[](#addsquare)

It adds a square (color-filled) on the image

```
$builder->addSquare(10, 10, 20, 20, 'ABCDEF');

```

===========================================================================

Author
------

[](#author)

- **Luca Giacalone** (AKA JackalOne)

License
-------

[](#license)

This project is licensed under the MIT License

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity18

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity55

Maturing project, gaining track record

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 ~79 days

Recently: every ~69 days

Total

11

Last Release

2199d ago

PHP version history (4 changes)0.3.5PHP &gt;=5.5.9|^7.0

0.3.7PHP &gt;=5.5.11|^7.0

0.4.0PHP ^5.6|^7.0

v0.4.2PHP &gt;=5.6

### Community

Maintainers

![](https://www.gravatar.com/avatar/13db4a2702d54af2cbbce04c934f80cddd423fc7a8ad12124cae6459b39e3a05?d=identicon)[lucajackal85](/maintainers/lucajackal85)

###  Code Quality

TestsPHPUnit

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/jackal-image-merge/health.svg)

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

###  Alternatives

[bkwld/croppa

Image thumbnail creation through specially formatted URLs for Laravel

510496.0k23](/packages/bkwld-croppa)[trntv/yii2-glide

Yii2 Glide Extension

41269.5k9](/packages/trntv-yii2-glide)[jolicode/media-bundle

A media management bundle for Symfony applications, with Easyadmin and SonataAdmin integrations.

1054.9k](/packages/jolicode-media-bundle)[mezcalito/imgproxy-bundle

115.7k2](/packages/mezcalito-imgproxy-bundle)[codebuds/webp-conversion-bundle

A Symfony bundle to generate WebPImages

124.1k](/packages/codebuds-webp-conversion-bundle)[inspiredminds/contao-image-alternatives

Contao extension to provide the possibility of defining alternative images to be used on different output devices.

121.9k](/packages/inspiredminds-contao-image-alternatives)

PHPackages © 2026

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