PHPackages                             smallpics/imagerx-smallpics - 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. smallpics/imagerx-smallpics

ActiveCraft-plugin[Image &amp; Media](/categories/media)

smallpics/imagerx-smallpics
===========================

Small Pics transformer for Imager X

1.1.0(1w ago)06.1k—3.3%MITPHPPHP ^8.1CI passing

Since Nov 12Pushed 1mo agoCompare

[ Source](https://github.com/SmallPics/imagerx-smallpics)[ Packagist](https://packagist.org/packages/smallpics/imagerx-smallpics)[ RSS](/packages/smallpics-imagerx-smallpics/feed)WikiDiscussions main Synced today

READMEChangelog (5)Dependencies (12)Versions (6)Used By (0)

Imager X Small Pics Transformer
===============================

[](#imager-x-small-pics-transformer)

[Small Pics](https://www.smallpics.io) is a fast, affordable image transform service with global edge caching and AVIF by default. This plugin adds Small Pics as a transformer for [Imager X](https://github.com/spacecatninja/craft-imager-x), giving you on-the-fly image resizing, cropping, format conversion, watermarks, and more through a simple [URL API](https://www.smallpics.io/docs).

Plans start at $9/mo with predictable, flat-tier pricing and no per-bandwidth charges. Works with any origin: S3, R2, DigitalOcean Spaces, Hetzner, or any HTTP source. Supports multiple origins per project and signed URLs for secure delivery.

Switching from Imgix? Small Pics includes an [Imgix parameter compatibility mode](https://www.smallpics.io/docs/imgix-compatibility), and most existing Imager X template code works with minimal changes. See the [migration guide](https://www.smallpics.io/blog/migrating-from-imgix-to-small-pics-with-imager-x) for a step-by-step walkthrough.

Requirements
------------

[](#requirements)

- Craft CMS 5.0.0+
- Imager X 5.1.0+
- PHP 8.2+

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

[](#installation)

```
composer require smallpics/imagerx-smallpics
php craft plugin/install imagerx-smallpics
```

Configuration
-------------

[](#configuration)

Add the Small Pics configuration to your Imager X Small Pics transformer config file (`config/imagerx-smallpics.php`):

### Options

[](#options)

#### baseUrl

[](#baseurl)

Base URL for your Small Pics origin.

Example: `https://your-origin.smallpics.io/`

#### secret

[](#secret)

Default: `null`.

Optional signing secret for your Small Pics image origin.

Setting this will enable URL signing for generated URLs. If your Small Pics config has signed URL disabled, then including a signature will have no effect on the transformed images.

#### transformSvgs

[](#transformsvgs)

Default: `false`.

Whether SVG images should be transformed.

#### transformAnimatedGifs

[](#transformanimatedgifs)

Default: `false`.

Whether animated GIF images should be transformed.

#### defaultParams

[](#defaultparams)

Global default parameters for Small Pics transformations. See the Small Pics [API documentation](https://www.smallpics.io/docs) for available options.

These are applied in addition to any default parameters configured per origin (if any), and are merged with any `transformerParams` passed when transforming an image.

#### origins

[](#origins)

An array of named origin configurations.

If you require multiple Small Pics origins, you can configure them here instead of configuring the root-level options.

Each origin configuration supports the same options as above, see [multi-origin config](#multi-origin-config) below for an example configuration and [multi-origin usage](#multi-origin-usage) for how to select an origin when transforming an image.

### Example configurations

[](#example-configurations)

#### Single origin config

[](#single-origin-config)

```
return [
    'baseUrl' => getenv('SMALLPICS_BASE_URL'),
    'secret' => getenv('SMALLPICS_SECRET') ?: null,
    'transformSvgs' => false,
    'transformAnimatedGifs' => false,
    'defaultParams' => [],
];
```

#### Multi-origin config

[](#multi-origin-config)

It is possible to configure multiple origins. You can then select the origin to use when transforming an image by setting the `origin` key in the `transformerParams` array.

```
return [
    'defaultParams' => [
        'format' => 'webp',
    ],
    'origins' => [
        \smallpics\imagerx\smallpics\models\Settings::DEFAULT_ORIGIN_NAME => [ // Or simply 'default'
            'baseUrl' => getenv('SMALLPICS_DEFAULT_ORIGIN_BASE_URL'),
            'secret' => getenv('SMALLPICS_DEFAULT_ORIGIN_SECRET') ?: null,
            'transformSvgs' => false,
            'transformAnimatedGifs' => false,
            'defaultParams' => [
                'quality' => 80,
            ],
        ],
        'origin2' => [
            'baseUrl' => getenv('SMALLPICS_ORIGIN2_BASE_URL'),
            'secret' => getenv('SMALLPICS_ORIGIN2_SECRET') ?: null,
            'transformSvgs' => true,
            'transformAnimatedGifs' => false,
            'defaultParams' => [
                'format' => 'png',
                'quality' => 90
            ],
        ],
    ],
];
```

You can also set the name of the default origin by setting the `defaultOrigin` key in the config:

```
return [
    'defaultOrigin' => 'spaces',
    'origins' => [
        'spaces' => [
            'baseUrl' => getenv('SMALLPICS_SPACES_BASE_URL'),
            // ...
        ],
        's3' => [
            'baseUrl' => getenv('SMALLPICS_S3_BASE_URL'),
            // ...
        ],
    ],
];
```

Usage
-----

[](#usage)

Once installed and configured, you can use the transformer with Imager X:

```
{% set transformedImages = craft.imagerx.transformImage(rawImage, [
  { width: 74, height: 74 },
  { width: 120, height: 120 },
  { width: 172, height: 172 },
  { width: 254, height: 254 }
], {
  mode: 'crop',
  transformerParams: {
    padding: 10,
    background: 'ff0000',
    border: {
      width: 10,
      color: '000000',
      borderMethod: 'overlay',
    }
  },
}) %}
```

### Multi-origin usage

[](#multi-origin-usage)

```
{% set transformedImages = craft.imagerx.transformImage(rawImage, [
  { width: 74, height: 74 },
  { width: 120, height: 120 },
  { width: 172, height: 172 },
  { width: 254, height: 254 }
], {
  mode: 'crop',
  transformerParams: {
    origin: 'origin2',
    padding: 10,
    background: 'ff0000',
    border: {
      width: 10,
      color: '000000',
      borderMethod: 'overlay',
    }
  },
}) %}
```

Notes
-----

[](#notes)

Take a look at the Small Pics [API documentation](https://www.smallpics.io/docs) for a list of available options to use in the `defaultParams` and `transformerParams` arrays.

This transformer uses [smallpics/smallpics-php](https://github.com/smallpics/smallpics-php) under the hood. Take a look there for more usage information.

###  Health Score

47

—

FairBetter than 93% of packages

Maintenance96

Actively maintained with recent releases

Popularity23

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity48

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 90.9% 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 ~55 days

Total

5

Last Release

10d ago

PHP version history (2 changes)1.0.0PHP ^8.2

1.0.1PHP ^8.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/c8b86130e9f7274fdc9b091bc20252a767b39ba6a25476d51ac0c2ae389b5ca9?d=identicon)[smallpicsio](/maintainers/smallpicsio)

---

Top Contributors

[![johnnynotsolucky](https://avatars.githubusercontent.com/u/4161106?v=4)](https://github.com/johnnynotsolucky "johnnynotsolucky (20 commits)")[![sjcallender](https://avatars.githubusercontent.com/u/984311?v=4)](https://github.com/sjcallender "sjcallender (2 commits)")

---

Tags

imageimager-xphpsmallpicssrcsrcsettransformerurl-builderprocessingimagestransformersmallpicsimagerx

###  Code Quality

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/smallpics-imagerx-smallpics/health.svg)

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

###  Alternatives

[league/glide

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

2.6k53.3M146](/packages/league-glide)[spacecatninja/imager-x

Ninja powered image transforms.

29405.1k38](/packages/spacecatninja-imager-x)

PHPackages © 2026

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