PHPackages                             rutkoski/simplify-thumb - 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. rutkoski/simplify-thumb

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

rutkoski/simplify-thumb
=======================

Thumbnail generation and image processing, extendable and with a fluent interface.

v1.0.0(10y ago)1123GPLPHPPHP &gt;=5.3

Since Mar 31Pushed 10y ago1 watchersCompare

[ Source](https://github.com/rutkoski/simplify-thumb)[ Packagist](https://packagist.org/packages/rutkoski/simplify-thumb)[ Docs](https://github.com/rutkoski/simplify-thumb)[ RSS](/packages/rutkoski-simplify-thumb/feed)WikiDiscussions master Synced 4w ago

READMEChangelog (1)Dependencies (1)Versions (2)Used By (0)

Simplify Thumb
==============

[](#simplify-thumb)

Thumbnail generation and image processing, extendable and with a fluent interface.

Usage:
------

[](#usage)

Basic example:

```
$thumb = new \Simplify\Thumb();

$filename = $thumb
    ->setBaseDir(dirname(__file__))
    ->setFilesPath('files/')
    ->setCachePath('files/cache/')
    ->load('dummy.jpg')
    ->resize(150, 150)
    ->cache()
    ->getCacheFilename();
```

The library uses the method's parameters (like resize/150/150) to check for an existing cache file and uses it instead of recreating the image.

### Output

[](#output)

Get the cached filename

```
$thumb->getCacheFilename();
```

or save it to a new location

```
$thumb->save('path/newfile.php');
```

or overwrite current image

```
$thumb->save();
```

or send the image to the browser

```
$thumb->output();
```

### Change formats

[](#change-formats)

Just use the PHP constants (IMAGETYPE\_PNG, IMAGETYPE\_JPEG, ...):

```
$thumb->cache(IMAGETYPE_PNG);
```

or

```
$thumb->output(IMAGETYPE_PNG);
```

Available methods
-----------------

[](#available-methods)

### Resize

[](#resize)

```
$thumb->resize($width, $height, $mode, $far, $r, $g, $b, $a);
```

The third parameter in resize changes how images are resized. It defaults to `Simplify_Thumb::FIT\_INSIDE`. Options for `$mode` are:

- `Simplify_Thumb::FIT_INSIDE` - resize the image to fit inside a box defined by `$width` and `$height`
- `Simplify_Thumb::FIT_OUTSIDE` - resize the image to fit outside a box defined by `$width` and `$height`
- `Simplify_Thumb::SCALE_TO_FIT` - resize the image to exactly `$width` and `$height`
- `Simplify_Thumb::NO_SCALE` - don't resize the image, that's usefull for enlarging the image canvas

The fourth parameters, `$far` (force aspect ratio), when true, forces the final image to be exactly `$width` by `$height` pixels. The `$r`, `$g`, `$b` and `$a` parameters set the color for the background, so, for example:

```
$thumb->resize(150, 150, Simplify_Thumb::FIT_INSIDE, true, 0, 0, 0, 0);
```

on a 300 x 100px image, would fit the image inside a 150 x 150px box with a black background.

### ZoomCrop

[](#zoomcrop)

Crops the image so that it fills the dimensions you specify. The third parameter specifies wich part of the image will be used.

```
$thumb->zoomCrop($width, $height, Simplify_Thumb::CENTER);
```

### PHP image filters

[](#php-image-filters)

```
$thumb->brightness($level);
$thumb->grayscale();
$thumb->negate();
$thumb->contrast($level);
$thumb->colorize($red, $green, $blue, $alpha);
$thumb->edgedetect();
$thumb->emboss();
$thumb->gaussianBlur();
$thumb->selectiveBlur();
$thumb->meanRemoval();
$thumb->smooth($level);
$thumb->pixelate($blockSize, $advanced);
```

### Offset

[](#offset)

Shrink/enlarge the image canvas and fill background with color.

```
$thumb->offset($top, $right, $bottom, $left, $r = 0, $g = 0, $b = 0, $a = 0);
```

`$top`, `$right`, `$bottom` and `left` are relative. Positive numbers make the canvas bigger, negative numbers make it smaller (crops the image).

Custom plugins
--------------

[](#custom-plugins)

Implement custom plugins by extending `Simplify_Thumb_Plugin` and calling:

```
$thumb->plugin($plugin);
```

where `$plugin` is the string representing the plugin class.

Example:

Plugin that overlays an image on top of the current one:

```
class \Simplify\Thumb\Plugin\Overlay extends \Simplify\Thumb\Plugin
{

    protected function process(\Simplify\Thumb\Processor $thumb, $overlayImage = null)
    {
    	$overlay = \Simplify\Thumb\Functions::load($overlayImage);

    	$w = imagesx($overlay);
    	$h = imagesy($overlay);

    	imagecopyresampled($thumb->image, $overlay, 0, 0, 0, 0, $w, $h, $w, $h);
    }

}
```

then:

```
$thumb->plugin('\Simplify\Thumb\Plugin\Overlay', 'overlay.png');
```

###  Health Score

27

—

LowBetter than 47% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity58

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

3743d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/38a8aa56ccd4771bee20cd5472ee31e01d6a0ffa1cabe46996b78067ed5c2994?d=identicon)[rutkoski](/maintainers/rutkoski)

---

Top Contributors

[![rutkoski](https://avatars.githubusercontent.com/u/165532?v=4)](https://github.com/rutkoski "rutkoski (22 commits)")

---

Tags

thumbnailimageresizeeffects

### Embed Badge

![Health badge](/badges/rutkoski-simplify-thumb/health.svg)

```
[![Health](https://phpackages.com/badges/rutkoski-simplify-thumb/health.svg)](https://phpackages.com/packages/rutkoski-simplify-thumb)
```

###  Alternatives

[intervention/image

PHP Image Processing

14.3k203.8M2.5k](/packages/intervention-image)[sybio/image-workshop

Powerful PHP class using GD library to work easily with images including layer notion (like Photoshop or GIMP)

854936.5k12](/packages/sybio-image-workshop)[intervention/image-laravel

Laravel Integration of Intervention Image

1558.1M161](/packages/intervention-image-laravel)[jbzoo/image

A PHP class that simplifies working with images

171128.5k3](/packages/jbzoo-image)[stefangabos/zebra_image

A single-file, lightweight PHP library designed for efficient image manipulation featuring methods for modifying images and applying filters

138115.5k7](/packages/stefangabos-zebra-image)[coldume/imagecraft

A reliable and extensible PHP image manipulation library

10034.0k2](/packages/coldume-imagecraft)

PHPackages © 2026

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