PHPackages                             superbig/craft3-imgix - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. superbig/craft3-imgix

ActiveCraft-plugin[Utility &amp; Helpers](/categories/utility)

superbig/craft3-imgix
=====================

Use Imgix with Craft

4.0.0(9mo ago)1226.8k7[3 issues](https://github.com/sjelfull/craft3-imgix/issues)[3 PRs](https://github.com/sjelfull/craft3-imgix/pulls)MITPHPCI failing

Since Oct 30Pushed 1mo ago1 watchersCompare

[ Source](https://github.com/sjelfull/craft3-imgix)[ Packagist](https://packagist.org/packages/superbig/craft3-imgix)[ RSS](/packages/superbig-craft3-imgix/feed)WikiDiscussions craft-4 Synced 1mo ago

READMEChangelog (9)Dependencies (4)Versions (15)Used By (0)

Imgix plugin for Craft CMS 5.x
==============================

[](#imgix-plugin-for-craft-cms-5x)

Use [Imgix](https://imgix.com) with Craft CMS to automatically optimize, resize, and transform your images on-the-fly.

[![Screenshot](resources/img/plugin-icon.png)](resources/img/plugin-icon.png)

What does this plugin do?
-------------------------

[](#what-does-this-plugin-do)

This plugin integrates Imgix's powerful image processing API with Craft CMS, giving you instant access to real-time image transformations. Instead of generating and storing multiple versions of your images on your server, Imgix handles all the heavy lifting in the cloud.

**Key features:**

- **On-demand image transformations** - Resize, crop, and optimize images dynamically via URL parameters
- **Automatic format selection** - Serve WebP, AVIF, or other modern formats automatically based on browser support
- **Responsive images made easy** - Generate perfect `srcset` attributes with minimal code
- **Smart cropping** - Automatically use Craft's focal points for intelligent cropping
- **Lazy loading support** - Built-in helpers for both JavaScript-based and native lazy loading
- **Cache purging** - Automatically purge Imgix's cache when you update assets in Craft
- **Signed URLs** - Secure your images with signed URLs to prevent unauthorized transformations

Perfect for high-traffic sites that need fast, optimized images without the server overhead.

---

Table of contents
-----------------

[](#table-of-contents)

- [Requirements](#requirements)
- [Installation](#installation)
- [Configuration](#configuration)
    - [Quick start](#quick-start)
    - [Configuration options](#configuration-options)
    - [Environment variables](#environment-variables)
- [Usage](#usage)
    - [Basic usage](#basic-usage)
    - [Transform options](#transform-options)
    - [Lazy loading](#lazy-loading)
    - [Advanced usage](#advanced-usage)
- [Common use cases](#common-use-cases)
- [Preventing upscaling](#preventing-upscaling)
- [Troubleshooting](#troubleshooting)
- [Roadmap](#roadmap)

**Understanding Volume Mapping:**

The `imgixDomains` array maps your Craft volume handles to Imgix domains. The plugin looks up the asset's volume handle to determine which Imgix domain to use.

- **Simple mapping:** `'uploads' => 'my-site.imgix.net'` - all assets from the 'uploads' volume use this domain
- **Path mapping:** `'heroImages' => 'my-site.imgix.net/heroes'` - adds a path prefix to all images
- **Multiple domains:** You can use different Imgix domains for different volumes

### Environment variables

[](#environment-variables)

It's recommended to store sensitive values like API keys in environment variables. In your `.env` file:

```
```bash
cd /path/to/project
```

```

2. Then tell Composer to load the plugin:

    ```
    composer require superbig/craft3-imgix
    ```
3. In the Control Panel, go to Settings → Plugins and click the “Install” button for Imgix.

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

[](#configuration)

### Quick start

[](#quick-start)

Copy the `config.php` file from the plugin's `src` directory into your Craft project's `config` folder and rename it to `imgix.php`.

**Basic configuration example:**

```
