PHPackages                             mostlyserious/craft-imgix-picture - 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. [Templating &amp; Views](/categories/templating)
4. /
5. mostlyserious/craft-imgix-picture

ActiveCraft-plugin[Templating &amp; Views](/categories/templating)

mostlyserious/craft-imgix-picture
=================================

A Twig helper to generate picture tags from a set of imgix transforms.

5.2.0(11mo ago)0131proprietaryPHPPHP &gt;=8.0.2

Since Jul 29Pushed 9mo ago2 watchersCompare

[ Source](https://github.com/mostlyserious/craft-imgix-picture)[ Packagist](https://packagist.org/packages/mostlyserious/craft-imgix-picture)[ RSS](/packages/mostlyserious-craft-imgix-picture/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (3)Versions (15)Used By (0)

imgix Picture
=============

[](#imgix-picture)

A Twig helper to generate responsive, optimized `` tags from a set of image transforms. It is intended for use with imgix, but can be used with Craft's native transforms also.

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

[](#requirements)

This plugin requires Craft CMS 4.9.0 or later, and PHP 8.0.2 or later.

It assumes that you have at least one Asset Volume and File System configured (Typically an Amazon S3 bucket) and a corresponding imgix source that references that Asset Volume's File System.

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

[](#installation)

You can install this plugin with Composer.

#### With Composer

[](#with-composer)

Open your terminal and run the following commands:

```
# go to the project directory
cd /path/to/my-project.test

# tell Composer to load the plugin
composer require mostlyserious/craft-imgix-picture

# tell Craft to install the plugin
./craft plugin/install imgix-picture
```

Getting Started
---------------

[](#getting-started)

Create an [imgix account](https://dashboard.imgix.com/sign-up) with at least one source and an [API Key](https://docs.imgix.com/apis/management/overview).

The API key requires `Purge` permissions, and it is used only to purge assets on Asset events, such as replace.

Add your imgix url and API key as environment variables to your `.env` file.

```
IMGIX_API_KEY="aXzY....."
IMGIX_SOURCE_URL="https://example.imgix.net"

```

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

[](#configuration)

Create a config file at `/config/imgix-picture.php`.

Configure an imgix source for each Asset Volume by adding each volume to the `volumes` array using the volume handle as the key.

```
