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

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

glaivepro/image
===============

Image manipulation via URLs for Laravel

1.2.0(2y ago)151MITPHP

Since Aug 1Pushed 2y ago2 watchersCompare

[ Source](https://github.com/GlaivePro/image)[ Packagist](https://packagist.org/packages/glaivepro/image)[ Docs](https://github.com/glaivepro/image)[ RSS](/packages/glaivepro-image/feed)WikiDiscussions master Synced 1w ago

READMEChangelog (7)Dependencies (5)Versions (10)Used By (0)

Image
=====

[](#image)

Image manipulation via URLs for Laravel. It provides a URL interface, while the manipulations themselves are done by [Intervention](https://image.intervention.io/).

The manipulated files are stored at the requested URL so the manipulation won't be repeated, but the file will directly be served by your web server.

This package is heavily inspired by [folklore/image](https://github.com/folkloreinc/laravel-image-legacy).

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

[](#installation)

```
composer require glaivepro/image
```

Currently this package does not publish any config, but the manipulations are done by intervention. In case you need to change the driver to imagick, you should [configure intervention](https://image.intervention.io/v2/introduction/configuration#configuration-in-laravel).

Usage
-----

[](#usage)

Let us consider an image that's publicly accessible as `example.com/img/some.jpg`.

This package will let you get a downsized and cropped version of this file via the URL `example.com/img/some-image(120x150).jpg`. The manipulated image will be stored in the `img` directory as `some-image(120x150).jpg` so that the next request to `example.com/img/some-image(120x150).jpg` will be handled by your web server providing the stored file.

If you want to downsize, but keep the aspect ratio, skip one of the dimensions:

- `example.com/img/some-image(200x_).jpg` — constrain width
- `example.com/img/some-image(_x90).jpg` — constrain height

Few other manipulations are available as well:

- `example.com/img/some-image(blur).jpg`
- `example.com/img/some-image(blur(10)).jpg`
- `example.com/img/some-image(pixelate(12)).jpg`
- `example.com/img/some-image(resize(120,140)).jpg` — resizing without cropping
- `example.com/img/some-image(100x200-pixelate(10)).jpg`
- `example.com/img/some-image(resize(120,140)-blur-pixelate(12)).jpg`

### Generating URLs

[](#generating-urls)

The simple (size constraining) URIs can be generated via our facade:

```
$uri = GPImage::url('img/some-image.jpg', 120, 150);
// $uri is 'img/some-image-image(120x150).jpg'
```

> **Note**The method is named `url` for compatibility with `folklore/image`. Even though this is not intended as a drop-in replacement, this case will be such if you redefine `Image` facade alias to point to `GlaivePro\Image\GPImage`.

Full URLs can be generated via the `asset` method:

```
$url = GPImage::asset('img/some-image.jpg', 120, 150);
// $url is 'https://example.com/img/some-image-image(120x150).jpg'
```

More complex URIs can be generated using the stringable `Uri` class:

```
use GlaivePro\Image\Uri;

$uri = new Uri('pic.jpg');
$uri->size(20, 400);

(string) $uri; // 'pic-image(20x400).jpg'
```

Instances of `Uri` can also be produced by the `url` and `asset` methods of the `GPImage` facade:

```
GPImage::asset('pic.jpg')->pixelate(12)->blur(10)->resize(100, 200);
// https://example.com/pic-image(pixelate(12)-blur(10)-resize(100,200)).jpg
```

### Custom filters

[](#custom-filters)

You can register your own filters that will receive the intervention instance and any arguments which you can then handle as needed:

```
// Called via 'somepic-image(simplefilter).jpg'
GPImage::filter('simplefilter', fn ($image) => $image->anyInterventionMethod());

// Called via 'somepic-image(complexfilter(10,20))'
GPImage::filter('complexfilter', function($image, $arg1, $arg2) {
	$tempArg = $arg1 * 2;
	$image->someInterventionMethod($tempArg, $arg1);
	$image->someOtherInterventionMethod();
});
```

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 98.6% 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 ~108 days

Recently: every ~161 days

Total

7

Last Release

737d ago

Major Versions

0.4.0 → 1.0.02022-08-11

### Community

Maintainers

![](https://www.gravatar.com/avatar/6674d01479885d0c1929e0529fd4aa68aaf2ca8e4816c774b55ea584de900135?d=identicon)[tontonsb](/maintainers/tontonsb)

---

Top Contributors

[![tontonsb](https://avatars.githubusercontent.com/u/16481303?v=4)](https://github.com/tontonsb "tontonsb (70 commits)")[![StyleCIBot](https://avatars.githubusercontent.com/u/11048387?v=4)](https://github.com/StyleCIBot "StyleCIBot (1 commits)")

---

Tags

hacktoberfestimage-manipulationlaravellaravelimage

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[intervention/image-laravel

Laravel Integration of Intervention Image

1496.5M102](/packages/intervention-image-laravel)[bkwld/croppa

Image thumbnail creation through specially formatted URLs for Laravel

510496.0k23](/packages/bkwld-croppa)[joshembling/image-optimizer

Optimize your Filament images before they reach your database.

111145.4k12](/packages/joshembling-image-optimizer)[danihidayatx/image-optimizer

Optimize your Filament images before they reach your database. Forked from joshembling/image-optimizer for Filament v4 &amp; v5 support.

254.4k](/packages/danihidayatx-image-optimizer)

PHPackages © 2026

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