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

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

andheiberg/image
================

Image processing library with on the fly processing of image requests.

1.1.0(11y ago)131702[1 issues](https://github.com/AndreasHeiberg/laravel-image/issues)PHPPHP &gt;=5.3.0

Since Jan 5Pushed 11y ago3 watchersCompare

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

READMEChangelogDependencies (3)Versions (7)Used By (0)

Image
=====

[](#image)

Image processing library wrapper with on the fly processing and caching of image requests. Currently supports ImageMagick and Gd.

Basic usage (don't use it this way it's mainly for documentation purposes)
--------------------------------------------------------------------------

[](#basic-usage-dont-use-it-this-way-its-mainly-for-documentation-purposes)

A route is set up for URL based image processing. The route can be configured but by default all requests to `/images?src=/path/to/image.png`. You can append verious parameters to this url to trigger different processing.

Supported parameters:

- h or height (desired pixel height of image)
- w or width (desired pixel width of image)
- preset (use a processing preset defined in the config)

**Example**

```

```

**Drawbacks**

- By linking to images this way, you demand that php runs on every image request. This is quite resource intensive for your server compared to a static file link and would increase download time.
- This also means that every image request would fail if you image script is unavailible or broken. (can be fixed by using the second example, but only for local images)

Proper usage
------------

[](#proper-usage)

In order to negate above mentions drawbacks use the url function. It takes a url and an array of options. It will output static file urls if the image is in the cache or a link formated like the examples in "Basic usage" if not.

```

```

Note: images that are not in cache will be processed upon request, and not imidiadly to decrease load time for your application.

Caching
-------

[](#caching)

Processed images are store to file in your prefered cachestore. Currently supports local and s3, but filestores can easily be added.

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

[](#installation)

Run `composer require andheiberg/image:1.*`

Add `'Andheiberg\Image\ImageServiceProvider',` to `providers` in `app/config/app.php`

Add `'Image' => 'Andheiberg\Image\Facades\Image',` to `aliases` in `app/config/app.php`

Run `php artisan config:publish andheiberg/image`

Add the following to you .htaccess or php.ini (add before laravels)

```

	# Resize on the fly
	RewriteCond %{QUERY_STRING}  ^(.+) [NC]
	RewriteRule ^(.+)\.(png|jpg|gif)$ /images?src=/$1.$2 [L,R,QSA]

```

Todo
----

[](#todo)

- Add support for more than just resize
- Add support for GraphicsMagick

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance18

Infrequent updates — may be unmaintained

Popularity19

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity62

Established project with proven stability

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 ~51 days

Recently: every ~61 days

Total

6

Last Release

4253d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/207626c3611f7c70c59a8164259c22cb1233b0a8e009d1feae3e45c9351d4c4c?d=identicon)[AndreasHeiberg](/maintainers/AndreasHeiberg)

---

Tags

laravelimageprocessingon-the-fly

### Embed Badge

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

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

###  Alternatives

[bkwld/croppa

Image thumbnail creation through specially formatted URLs for Laravel

510496.0k23](/packages/bkwld-croppa)[intervention/image-laravel

Laravel Integration of Intervention Image

1496.5M102](/packages/intervention-image-laravel)[spescina/imgproxy

An image proxy for Laravel

201.3k](/packages/spescina-imgproxy)

PHPackages © 2026

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