← Back to blog

Migrating from Imgix to Small Pics with Imager X

· Small Pics

To migrate from Imgix to Small Pics in Craft CMS, install the Small Pics Imager X transformer, update your environment variables, and rename a few transform parameters. The whole process takes under an hour.

If you’re a Craft CMS developer using Imager X with Imgix transforms, switching to Small Pics is straightforward. We’ve built a dedicated Imager X transformer that plugs directly into your existing setup. No need to rewrite your templates from scratch.

Why switch from Imgix to Small Pics?

Imgix works, but the pricing adds up fast, especially when you’re managing multiple client sites. Small Pics offers predictable, tiered pricing starting at $9/mo with no credit math. Imgix has a larger API surface (100+ operations) and a more mature ecosystem. For the core transforms most sites need (resize, crop, format, quality, watermarks), both cover the use case. The difference is billing model and migration effort.

What does the Small Pics transformer support?

The Small Pics Imager X transformer supports these native Imager X properties:

  • width
  • height
  • format
  • mode (fit maps to contain)

You can also pass any Small Pics-specific parameters via transformerParams. These use the same format described in the Small Pics PHP package docs. Focal point configs are automatically supported when mode=fit.

How do you install the Small Pics transformer?

Step 1: Install the transformer package

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

Step 2: Set environment variables

Add these to your .env file:

# Switch Imager X to the Small Pics transformer
IMAGERX_TRANSFORMER=smallpics

# Your Small Pics image source base URL
SMALLPICS_BASE_URL=https://media.myproject.com

# Optional: only needed if your image source requires signed URLs
SMALLPICS_SECRET=your-signing-secret

Step 3: Update imager-x.php config

Point the transformer to your new environment variable:

return [
    'transformer' => getenv('IMAGERX_TRANSFORMER'),
    'useForNativeTransforms' => true,
    'useForCpThumbs' => true,
];

You can remove the imgixApiKey and imgixConfig blocks entirely. They’re no longer needed.

Step 4: Add imagerx-smallpics.php config

Create a new config file at config/imagerx-smallpics.php:

return [
    'baseUrl' => App::env('SMALLPICS_BASE_URL'),
    'secret' => App::env('SMALLPICS_SECRET'),
    'defaultParams' => [
        'format' => 'avif', // Not required, this is the Small Pics default
        'quality' => 85,    // Not required, this is the Small Pics default
    ],
];

What config changes are needed in your templates?

Update any transformImage calls to use Small Pics transform parameters instead of Imgix ones. The changes are minimal, mostly renaming parameters.

The mode, width, and height params work the same. Everything else moves into transformerParams using Small Pics-native names. See the full list of supported parameters.

How do you migrate watermarks?

Can you migrate without renaming any parameters?

Yes. If you want an even simpler migration path, Small Pics has built-in Imgix parameter compatibility that can be enabled per image source in the dashboard.

When enabled, Small Pics translates Imgix query parameters to their Small Pics equivalents server-side. Most core parameters are supported: w, h, fit, crop, fp-x, fp-y, dpr, fm, q, sharp, bri, con, gam, flip, orient, bg, border, pad, and the full set of watermark parameters.

This is especially useful for:

  • Sites not using Imager X that have Imgix URLs hardcoded in templates or a CMS
  • Teams that want zero-effort migration with no template changes at all
  • Staging environments where you want to verify output before touching any code

Enable Imgix compatibility on your Small Pics image source, point your DNS, and your existing URLs keep working. You can always switch to native Small Pics parameters later if you want to. See the full Imgix parameter mapping for the complete list of supported parameters.

How do you verify the migration?

  • View source and confirm image URLs point to your Small Pics domain
  • Check that focal points and cropping behave as expected

To recap:

  1. Install the transformer plugin via Composer
  2. Add your Small Pics env vars
  3. Point imager-x.php at the new transformer
  4. Create imagerx-smallpics.php with your base URL and defaults
  5. Find and replace Imgix params with their Small Pics equivalents
  6. Verify your images load

Your Twig templates barely change. You’re mostly just swapping out the transformer config and tweaking a few parameter names. If you’re already on Imager X, the whole thing takes well under an hour.

Need help migrating?

We’ve migrated multiple production Craft CMS sites from Imgix to Small Pics and we’re happy to help you do the same. If you run into any issues or just want a hand with the switch, reach out to us at support@smallpics.io. We’ll walk through it with you.

Frequently asked questions

How long does it take to migrate from Imgix to Small Pics?
If you are using Imager X with Craft CMS, the migration takes under an hour. Install the Small Pics transformer plugin, update your environment variables, and rename a few transform parameters.
Do I need to rewrite my Twig templates?
No. Your existing transformImage calls keep working. The main changes are in config files and environment variables. Some Imgix-specific parameters need renaming (e.g. jpegQuality becomes q).
What Imager X properties does the Small Pics transformer support?
The transformer supports width, height, format, and mode natively. All other Small Pics parameters can be passed via transformerParams in your Twig templates.
Does Small Pics support watermarks like Imgix?
Yes. Watermarks are applied via the mark, markpos, and markalpha parameters in transformerParams. The syntax differs from Imgix but the functionality is equivalent.
How much cheaper is Small Pics than Imgix?
Small Pics Starter plan is $19/mo for 5,000 origin images and 35,000 transforms. Imgix starts at $25/mo for 100 credits, but credits cover storage, delivery, and transforms in one bucket with unpublished per-transform rates, so actual costs are hard to predict.
Can I use Small Pics and Imgix at the same time during migration?
Yes. You can switch the transformer per environment using the IMAGERX_TRANSFORMER environment variable. Run Imgix in production and Small Pics in staging to verify everything works before switching over.
Can I migrate from Imgix without renaming any parameters?
Yes. Small Pics has built-in Imgix parameter compatibility that can be enabled per image source. When enabled, your existing Imgix URLs work without changes. This is useful for sites not using Imager X, or for teams that want zero-effort migration.

More from the blog

View all posts

Ready to make your website's images smaller?

Plans from $9/mo. Start a 14-day free trial, no credit card required.