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

441.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 3d 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 47% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity32

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

[goat1000/svggraph

Generates SVG graphs

135911.1k3](/packages/goat1000-svggraph)[gravatarphp/gravatar

Gravatar URL builder which is most commonly called as a Gravatar library

16653.6k2](/packages/gravatarphp-gravatar)

PHPackages © 2026

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