PHPackages                             mperonnet/imgproxy-php - 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. mperonnet/imgproxy-php

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

mperonnet/imgproxy-php
======================

ImgProxy URL builder with complete Pro features support for PHP, based on onliner/imgproxy-php

v1.0.3(2mo ago)28.1k↓40.3%11MITPHPPHP ^8.0CI passing

Since Jul 14Pushed 2mo ago1 watchersCompare

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

READMEChangelog (1)Dependencies (4)Versions (12)Used By (1)

ImgProxy PHP
============

[](#imgproxy-php)

A comprehensive PHP library for building URLs for [ImgProxy](https://imgproxy.net), supporting all features including pro options.

This library is based on and extends the work of the [onliner/imgproxy-php](https://github.com/onliner/imgproxy-php) project, adding support for all ImgProxy features including Pro functionality.

[![Version](https://camo.githubusercontent.com/c5ba056a423654a21fc3381c3c3604a9bf62ffe5b5bcf6790d8fdc3f96e6496b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6d7065726f6e6e65742f696d6770726f78792d7068702e737667)](https://packagist.org/packages/mperonnet/imgproxy-php)[![Total Downloads](https://camo.githubusercontent.com/31b78b10bee6fb5e25bc3617e86dcb73e0b0030e36c36d0a27a67337f271e81f/68747470733a2f2f706f7365722e707567782e6f72672f6d7065726f6e6e65742f696d6770726f78792d7068702f646f776e6c6f6164732e737667)](https://packagist.org/packages/mperonnet/imgproxy-php)[![Php](https://camo.githubusercontent.com/b8a795120c5532cd2ac4abba74592c798be1eef6dfb123f81e8792b8fea4c84b/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d382e302b2d627269676874677265656e2e737667)](https://www.php.net/)[![License](https://camo.githubusercontent.com/074b89bca64d3edc93a1db6c7e3b1636b874540ba91d66367c0e5e354c56d0ea/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e737667)](LICENSE)[![Build Status](https://github.com/mperonnet/imgproxy-php/workflows/test/badge.svg)](https://github.com/mperonnet/imgproxy-php/actions?workflow=test)

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

[](#installation)

The preferred way to install this extension is through [composer](http://getcomposer.org/download/).

```
composer require mperonnet/imgproxy-php
```

Features
--------

[](#features)

- Full support for all ImgProxy options (including Pro features)
- URL signing and encryption
- Base64 and plain URL encoding
- Support for info endpoint
- Support for presets
- Support for chained pipelines (Pro)
- Type-safe option builders
- Immutable, fluent interface

Basic Usage
-----------

[](#basic-usage)

```
use Mperonnet\ImgProxy\UrlBuilder;
use Mperonnet\ImgProxy\Options\Width;
use Mperonnet\ImgProxy\Options\Height;
use Mperonnet\ImgProxy\Options\Quality;
use Mperonnet\ImgProxy\Options\Dpr;

$key = getenv('IMGPROXY_KEY');
$salt = getenv('IMGPROXY_SALT');

$src = 'http://example.com/image.jpg';

$builder = UrlBuilder::signed($key, $salt);
$builder = $builder->with(
    new Dpr(2),
    new Quality(90),
    new Width(300),
    new Height(400)
);

$url = $builder->url($src);  // Base64-encoded URL
$url = $builder->usePlain()->url($src); // Plain URL
$url = $builder->url($src, 'png'); // Change image format
```

URL Formats
-----------

[](#url-formats)

### Base64-encoded URL (default)

[](#base64-encoded-url-default)

```
$url = $builder->useBase64()->url($src);
// Example: /9SaGqJILqstFsWthdP/dpr:2/q:90/w:300/h:400/aHR0cDovL2V4YW1wL2ltYWdlLmpwZw
```

### Plain URL

[](#plain-url)

```
$url = $builder->usePlain()->url($src);
// Example: /9SaGqJILqstFsWthdP/dpr:2/q:90/w:300/h:400/plain/http://example.com/image.jpg
```

### Encrypted URL (Pro)

[](#encrypted-url-pro)

```
$encryptionKey = getenv('IMGPROXY_ENCRYPTION_KEY');
$url = $builder->useEncryption($encryptionKey)->url($src);
// Example: /9SaGqJILqstFsWthdP/dpr:2/q:90/w:300/h:400/enc/a1b2c3d4e5f6g7h8i9j0...
```

Advanced Features
-----------------

[](#advanced-features)

### Gravity

[](#gravity)

```
use Mperonnet\ImgProxy\Options\Gravity;
use Mperonnet\ImgProxy\Support\GravityType;

// Basic gravity
$builder->with(new Gravity(GravityType::CENTER));

// With offset
$builder->with(new Gravity(GravityType::NORTH_WEST, 10, 20));

// Smart gravity
$builder->with(Gravity::smart());

// Focus point gravity
$builder->with(Gravity::focusPoint(0.7, 0.3));

// Object detection gravity (Pro)
$builder->with(Gravity::object(['face', 'cat']));

// Weighted object detection gravity (Pro)
$builder->with(Gravity::objectWeighted(['face' => 2, 'cat' => 1]));
```

### Watermark

[](#watermark)

```
use Mperonnet\ImgProxy\Options\Watermark;
use Mperonnet\ImgProxy\Options\WatermarkText;
use Mperonnet\ImgProxy\Options\WatermarkUrl;

// Basic watermark
$builder->with(Watermark::center(0.5, 10, 10, 0.3));

// Replicated watermark
$builder->with(Watermark::replicate(0.5));

// Custom watermark URL (Pro)
$builder->with(new WatermarkUrl('http://example.com/watermark.png'));

// Text watermark (Pro)
$builder->with(new WatermarkText('© Example Corporation'));
```

### Info Endpoint (Pro)

[](#info-endpoint-pro)

```
use Mperonnet\ImgProxy\Options\InfoOptions;

// Basic info
$infoUrl = $builder->info()->with(InfoOptions::basic())->url($src);

// Complete info
$infoUrl = $builder->info()->with(InfoOptions::complete())->url($src);

// Custom info
$infoUrl = $builder->info()->with(
    new InfoOptions(
        true,  // size
        true,  // format
        true,  // dimensions
        false, // exif
        false, // iptc
        false, // xmp
        true,  // video_meta
        true   // detect_objects
    )
)->url($src);
```

### Chained Pipelines (Pro)

[](#chained-pipelines-pro)

```
use Mperonnet\ImgProxy\Options\Resize;
use Mperonnet\ImgProxy\Options\Blur;
use Mperonnet\ImgProxy\Options\Watermark;

// First resize, then blur and add watermark
$url = $builder
    ->with(new Resize('fit', 300, 300))
    ->pipeline(
        new Blur(10),
        Watermark::southEast(0.7)
    )
    ->url($src);
```

Additional Processing Options
-----------------------------

[](#additional-processing-options)

### Resizing and Dimensions

[](#resizing-and-dimensions)

```
use Mperonnet\ImgProxy\Options\Resize;
use Mperonnet\ImgProxy\Options\Size;
use Mperonnet\ImgProxy\Options\Width;
use Mperonnet\ImgProxy\Options\Height;
use Mperonnet\ImgProxy\Options\MinWidth;
use Mperonnet\ImgProxy\Options\MinHeight;
use Mperonnet\ImgProxy\Options\Zoom;
use Mperonnet\ImgProxy\Options\Dpr;

$builder->with(
    new Resize('fill', 300, 400, true, false),
    new Size(300, 400, true, false),
    new Width(300),
    new Height(400),
    new MinWidth(200),
    new MinHeight(200),
    new Zoom(1.5),
    new Dpr(2)
);
```

### Image Adjustments

[](#image-adjustments)

```
use Mperonnet\ImgProxy\Options\Adjust;
use Mperonnet\ImgProxy\Options\Brightness;
use Mperonnet\ImgProxy\Options\Contrast;
use Mperonnet\ImgProxy\Options\Saturation;

$builder->with(
    new Adjust(10, 1.1, 0.9),
    new Brightness(10),
    new Contrast(1.1),
    new Saturation(0.9)
);
```

### Color Effects

[](#color-effects)

```
use Mperonnet\ImgProxy\Options\Background;
use Mperonnet\ImgProxy\Options\Blur;
use Mperonnet\ImgProxy\Options\Sharpen;
use Mperonnet\ImgProxy\Options\Monochrome;
use Mperonnet\ImgProxy\Options\Duotone;
use Mperonnet\ImgProxy\Options\Colorize;
use Mperonnet\ImgProxy\Options\Gradient;
use Mperonnet\ImgProxy\Support\Color;

$builder->with(
    new Background(new Color(255, 255, 255)),
    new Blur(5),
    new Sharpen(0.7),
    new Monochrome(0.8, 'b3b3b3'),
    new Duotone(0.8, '000000', 'ffffff'),
    new Colorize(0.5, '3498db', true),
    new Gradient(0.7, 'ff0000', 45, 0.2, 0.8)
);
```

### Format and Quality

[](#format-and-quality)

```
use Mperonnet\ImgProxy\Options\Format;
use Mperonnet\ImgProxy\Options\Quality;
use Mperonnet\ImgProxy\Options\FormatQuality;
use Mperonnet\ImgProxy\Options\Autoquality;
use Mperonnet\ImgProxy\Options\MaxBytes;

$builder->with(
    new Format('webp'),
    new Quality(85),
    new FormatQuality([
        'jpeg' => 85,
        'webp' => 80,
        'avif' => 60
    ]),
    Autoquality::dssim(0.02, 70, 85, 0.001),
    new MaxBytes(100000)
);
```

### Object Detection (Pro)

[](#object-detection-pro)

```
use Mperonnet\ImgProxy\Options\BlurDetections;
use Mperonnet\ImgProxy\Options\DrawDetections;

$builder->with(
    new BlurDetections(5, ['face']),
    new DrawDetections(true, ['face', 'cat'])
);
```

Credits
-------

[](#credits)

This library is an extension of the [onliner/imgproxy-php](https://github.com/onliner/imgproxy-php) project with added support for ImgProxy Pro features and a more comprehensive API. We're grateful to the original authors for providing the foundation that made this extension possible.

License
-------

[](#license)

Released under the [MIT license](LICENSE).

###  Health Score

52

—

FairBetter than 96% of packages

Maintenance87

Actively maintained with recent releases

Popularity29

Limited adoption so far

Community19

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor1

Top contributor holds 66.7% 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 ~170 days

Recently: every ~135 days

Total

11

Last Release

64d ago

Major Versions

v0.2.4 → v1.0.02025-05-08

PHP version history (2 changes)v0.1.0PHP ^7.2 || ^8.0

v0.2.0PHP ^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/0f7b2b371338f7ead3e54ce8ece2335ab16b84266911d9e3af155dc80083f5f0?d=identicon)[mperonnet](/maintainers/mperonnet)

---

Top Contributors

[![mohorev](https://avatars.githubusercontent.com/u/4974062?v=4)](https://github.com/mohorev "mohorev (26 commits)")[![mperonnet](https://avatars.githubusercontent.com/u/2752742?v=4)](https://github.com/mperonnet "mperonnet (7 commits)")[![oprypkhantc](https://avatars.githubusercontent.com/u/54406427?v=4)](https://github.com/oprypkhantc "oprypkhantc (2 commits)")[![dcanob](https://avatars.githubusercontent.com/u/7740721?v=4)](https://github.com/dcanob "dcanob (1 commits)")[![akarashchuk](https://avatars.githubusercontent.com/u/15956414?v=4)](https://github.com/akarashchuk "akarashchuk (1 commits)")[![Olden](https://avatars.githubusercontent.com/u/546682?v=4)](https://github.com/Olden "Olden (1 commits)")[![VentyCZ](https://avatars.githubusercontent.com/u/3247664?v=4)](https://github.com/VentyCZ "VentyCZ (1 commits)")

---

Tags

imageprocessingresizeoptimizationimgproxyimageproxypro

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/mperonnet-imgproxy-php/health.svg)

```
[![Health](https://phpackages.com/badges/mperonnet-imgproxy-php/health.svg)](https://phpackages.com/packages/mperonnet-imgproxy-php)
```

###  Alternatives

[intervention/image

PHP Image Processing

14.3k194.3M2.2k](/packages/intervention-image)[league/glide

Wonderfully easy on-demand image manipulation library with an HTTP based API.

2.6k51.2M116](/packages/league-glide)[gumlet/php-image-resize

PHP class to re-size and scale images

1.2k5.7M54](/packages/gumlet-php-image-resize)[ps/image-optimizer

Image optimization / compression library. This library is able to optimize png, jpg and gif files in very easy and handy way. It uses optipng, pngquant, pngcrush, pngout, gifsicle, jpegoptim and jpegtran tools.

9341.7M25](/packages/ps-image-optimizer)[jcupitt/vips

A high-level interface to the libvips image processing library.

6961.6M31](/packages/jcupitt-vips)[masterexploder/phpthumb

A library for manipulating images in PHP.

981751.7k17](/packages/masterexploder-phpthumb)

PHPackages © 2026

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