PHPackages                             raitisg/imagetool - 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. raitisg/imagetool

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

raitisg/imagetool
=================

Different tools/functions to perform various tasks with images

451.7k18[1 issues](https://github.com/raitisg/CakePHP-ImageTool-Component/issues)PHP

Since Mar 25Pushed 4y ago1 watchersCompare

[ Source](https://github.com/raitisg/CakePHP-ImageTool-Component)[ Packagist](https://packagist.org/packages/raitisg/imagetool)[ RSS](/packages/raitisg-imagetool/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

CakePHP ImageTool Component
===========================

[](#cakephp-imagetool-component)

About
-----

[](#about)

ImageTool is php class to perform various tasks with images. Every function accepts GD resource as input and can output it as well (just leave 'output' option empty).

Changes from 1.1.\*
-------------------

[](#changes-from-11)

This library now consists purely from static functions as there was no need for class object. This makes it very easy to use in cake's models or anywhere else and isn't cakephp specific.

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

[](#installation)

For use with cakephp:

- Copy ImageTool.php to your app's Vendor/ directory
- Include in your controller: App::import('Vendor', 'ImageTool');

For use as standalone library:

- Include in your project with include() or similar method

Error handling
--------------

[](#error-handling)

Most image processing functions return either true or false (depending if action was successfull). Only exception is when you don't specify output (or set it to null/empty) - in such cases (if action was successfull) GD resource is returned.

PHP requirements
----------------

[](#php-requirements)

Minimum PHP version is 5.4 due to new array syntax used in library. If needed you can replace \[\] to array() in places arrays are used if you can't use 5.4 or higher version

Available functions
-------------------

[](#available-functions)

- autorotate - autorotate JPG images (by exif data)
- averageColor - get image's average color
- dominatingColor - get image's dominating color
- flip - flip image
- grayscale - desaturate image
- meshify - add mesh (grid of dots) over image
- pixelate - pixelate image
- resize - resize image
- rotate - rotate image (only degrees divisible by 90)
- unsharpMask - sharpen image
- watermark - add watermark

Examples
--------

[](#examples)

Make thumbnail 100x100px in size

```
$status = ImageTool::resize(array(
	'input' => $input_file,
	'output' => $output_file,
	'width' => 100,
	'height' => 100
));

```

Resize image (while keeping ratio) with max width and height both set to 600px. After that place watermark image in bottom-right corner and sharpen end result (with default settings)

```
$status = ImageTool::resize(array(
	'input' => $input_file,
	'output' => $output_file,
	'width' => 600,
	'height' => 600,
	'mode' => 'fit',
	'paddings' => false,
	'afterCallbacks' => array(
		array('watermark', array('watermark' => $watermark_file, 'position' => 'bottom-right')),
		array('unsharpMask'),
	)
));

```

Autorotate image (getting back GD resource and then passing it to the next function (greyscale) - similar to previous example but without using afterCallbacks option)

```
$image = ImageTool::autorotate(array(
	'input' => $input_file,
	'output' => null
));

if ($image) {
	$status = ImageTool::grayscale(array(
		'input' => $image,
		'output' => $output_file
	));
} else {
	$status = false;
}

```

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity31

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity34

Early-stage or recently created project

 Bus Factor1

Top contributor holds 96.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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/053c422a75c2a5cf90be3ae1036de4869545ce3e7b1147eb752da65b1bb6c48e?d=identicon)[raitisg](/maintainers/raitisg)

---

Top Contributors

[![raitisg](https://avatars.githubusercontent.com/u/763837?v=4)](https://github.com/raitisg "raitisg (29 commits)")[![GiancarloGomez](https://avatars.githubusercontent.com/u/152279?v=4)](https://github.com/GiancarloGomez "GiancarloGomez (1 commits)")

### Embed Badge

![Health badge](/badges/raitisg-imagetool/health.svg)

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

###  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)[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)[humanmade/tachyon-plugin

Rewrites WordPress image URLs to use Tachyon

87338.5k2](/packages/humanmade-tachyon-plugin)

PHPackages © 2026

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