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

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

yannickl88/image
================

Library for reading, transforming and writing image files.

2.1.1(3y ago)14152MITPHPPHP &gt;=7.2CI failing

Since Oct 19Pushed 1y ago1 watchersCompare

[ Source](https://github.com/yannickl88/image)[ Packagist](https://packagist.org/packages/yannickl88/image)[ RSS](/packages/yannickl88-image/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (8)Dependencies (3)Versions (10)Used By (0)

Easy reading, transforming and writing image files using PHP
------------------------------------------------------------

[](#easy-reading-transforming-and-writing-image-files-using-php)

[![Latest Version](https://camo.githubusercontent.com/ed8186821a10b1e0426767cfb5aff3e3c58fdf730a1be45313693ab009a64b45/687474703a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f79616e6e69636b6c38382f696d6167652e7376673f7374796c653d666c61742d737175617265)](https://github.com/yannickl88/image/releases)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](https://github.com/yannickl88/image)[![Build Status](https://camo.githubusercontent.com/5c7ee72ff76e7fea365077778e2702fda8581686347d465e3a5c03d4c4d567d6/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f79616e6e69636b6c38382f696d6167652f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/yannickl88/image)

Library for reading, transforming and writing image files.

This libary was born out of the need to have a consistent API for interacting with images. The goal is to have simple methods for common image tasks like cropping and resizing.

Usage
-----

[](#usage)

Supported file extensions for reading:

- PNG
- JPG
- JPEG
- GIF

Supported file extension for writing:

- PNG
- WEBP (if mod gd has been enabled with WebP support)

Example usages:

```
$image = \Yannickl88\Image\Image::fromFile('/some/image.png');

// Resize to 50 x 50
$thumbnail = $image->resize(50, 50);
$thumbnail->save('/some/thumbnail.png');

// Fit the image to a width and height of 50, 50 while maintaining it's aspect ratio.
$thumbnail = $image->fit(50, 50);
$thumbnail->save('/some/thumbnail.png');

// Crop at 50, 50 with a square of 100 x 100
$thumbnail = $image->crop([50, 50, 100, 100]);
$thumbnail->save('/some/thumbnail.png');

// Resize and crop at the same time
$thumbnail = $image->sampleTo([50, 50, 100, 100], [0, 0, 50, 50]);
$thumbnail->save('/some/thumbnail.png');

// Set the quality, where 0 being low and 1 high (value between 0 and 1)
$compressed = $image->quality(0.25);
$compressed->save('/some/preview.png');

// Get image width
var_dump($image->width()); // int

// Get image height
var_dump($image->height()); // int

// Get image bounding box
var_dump($image->rect()); // array(0, 0, width, height)

// Get a color at a given coordinate
var_dump($image->color(0, 0)); // array(red, green, blue, alpha)

// Get the image orientation
var_dump($image->orientation()); // ImageInterface::ORIENTATION_LANDSCAPE

// Get the raw data and output it
header('Content-type: image/png');
header('Content-Disposition: filename="image.png"');
echo $image->data('.png');
```

Migration
---------

[](#migration)

See [Migration Guide](MIGRATION.md).

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

[](#installation)

- `$ composer require yannickl88/image`
- This library follows [semantic versioning](http://semver.org/) strictly.

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance31

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 96.3% 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

Every ~147 days

Recently: every ~178 days

Total

8

Last Release

1366d ago

Major Versions

1.3.1 → 2.0.02021-01-13

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/5468127?v=4)[Yannick de Lange](/maintainers/yannickl88)[@yannickl88](https://github.com/yannickl88)

---

Top Contributors

[![yannickl88](https://avatars.githubusercontent.com/u/5468127?v=4)](https://github.com/yannickl88 "yannickl88 (26 commits)")[![DavidGoodwin](https://avatars.githubusercontent.com/u/203929?v=4)](https://github.com/DavidGoodwin "DavidGoodwin (1 commits)")

---

Tags

animatedimage-processingphp

###  Code Quality

TestsPHPUnit

Static AnalysisPsalm

Type Coverage Yes

### Embed Badge

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

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

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