PHPackages                             lewnelson/image-manipulation - 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. lewnelson/image-manipulation

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

lewnelson/image-manipulation
============================

Image manipulation, generate thumbnails

0.1.0(10y ago)1201MITPHPPHP &gt;=5.3.1

Since Oct 17Pushed 10y ago2 watchersCompare

[ Source](https://github.com/lewnelson/image-manipulation)[ Packagist](https://packagist.org/packages/lewnelson/image-manipulation)[ RSS](/packages/lewnelson-image-manipulation/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (4)Used By (0)

image-manipulation
==================

[](#image-manipulation)

A PHP class to manipulate images

This PHP tool is designed to generate thumbnails given the path to an image. Currently it supports png, gif and jpg images.

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

[](#installation)

Update composer.json

```
{
    "require": {
        "lewnelson/image-manipulation": "dev-master@dev"
    }
}

```

Usage
-----

[](#usage)

To get started ensure you have loaded all classes into your script, then run the following:

```
use LewNelson\ImageManipulation\ImageManipulation;

$collection = ImageManipulation::init($images);

```

Where $images is either a string of a path to an image or an array of paths to images. This will output either a string or array of ImageManipulation objects depending on the input. If you input an array the output will be an array with the same keys.

To generate a thumbnail you can then run the generateThumbnail() method on your ImageManipulation instances. By default without further configuration this will create a thumbnail in the same directory as the original image, prefixed by thumbnail\_ with a max width of 120 and max height of 120.

The return from generating a thumbnail is an instance of the PHP class SplFileInfo.

The generateThumbnail() method accepts one parameter $options which is an array of options. This array consists of key =&gt; value pairs. The following options are available.

- max\_width = integer, maximum thumbnail width (default = 120)
- max\_height = integer, maximum thumbnail height (default = 120)
- prefix = string, prefix to new thumbnail name (default = thumbnail\_)
- suffix = string, suffix to new thumbnail name (default = null)
- jpeg\_quality = integer 0-100, compression quality of new jpeg thumbnails (default = 75)
- png\_quality = integer 0-9, compression quality of new png thumbnails (default = 3)

In addition to setting these options you can also specify a location other than alongside the current image. This can be set via the setLocation((string)$location) method and passing an argument $location which is the new path.

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity50

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

3866d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/15097b4959a7e01654d8bc34fe2680df1a58866436d77c8d40594fc79c6cc118?d=identicon)[lewnelson](/maintainers/lewnelson)

---

Top Contributors

[![lewnelson](https://avatars.githubusercontent.com/u/11139198?v=4)](https://github.com/lewnelson "lewnelson (12 commits)")

### Embed Badge

![Health badge](/badges/lewnelson-image-manipulation/health.svg)

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

###  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)
