imgix APIsRendering APIAutomatic

Automatic

auto

Original : 185kB
sandbox-demo
auto=compress : 35kB
sandbox-demo

The auto parameter helps you automate a baseline level of optimization across your entire image catalog. Currently, it has four different methods:

  • Compression
  • Visual enhancement
  • File format conversion
  • Redeye removal

If necessary for your image needs, you can override the settings that auto represents, either on a per-image basis or in your code. For example, auto=compress removes color profile metadata, but if it’s necessary for your site, you can append a different value for cs in your image URL such as cs=origin or cs=srgb.

Note: auto=format is available as a Default Parameter for paying customers. Customers on our Free plans will be prompted to upgrade their account when attempting to add auto=format as a Default parameter.

auto values can be combined with comma separation, e.g. auto=compress,enhance. Additionally, it is the only parameter that can be combined by reiteration, e.g. auto=compress&auto=enhance&auto=format.

auto=compress

When auto=compress is set, imgix will apply best-effort techniques to reduce the size of the image. This includes altering our normal processing algorithm to apply more aggressive image compression.

If auto=format is included in the query, it will be respected. In this case, images will be served in AVIF format whenever possible while still applying compression. When AVIF is not supported, the image will be served as a WebP. If the WebP format is not supported, images that contain transparency will be served in a PNG8 format (if supported) and all others will be served as JPEG. The quality standard (q) is set to 45.

Note: We strive to reduce file size while maintaining as much visual information as possible, so the operations applied are subject to change. This becomes visible on images using a high gamut range as seen in the below examples. Adding cs=origin will resolve color issues by adding the original color space back. Additionally, the default quality standard can be overridden by using the q parameter.

Original
auto=compress
Original
auto=compress&cs=origin

Note: When used in conjunction with fm for non-animated assets, auto=compress will override the fm parameter and will use a JPEG or PNG file depending on if an alpha channel is present

Original : 185kB
sandbox-demo
auto=compress : 35kB
sandbox-demo

auto=enhance

When auto=enhance is set, the image is adjusted using the distribution of highlights, midtones, and shadows across all three channels—red, green, and blue (RGB). Overall, the enhancement gives images a more vibrant appearance.

The adjustment affects individual images differently, and works best with editorial photography, stock photography, and user-generated content for social media applications.

auto=enhance
sandbox-demo
auto=enhance
sandbox-demo

auto=true

When auto=true is set, imgix wil automatically adjust your asset by applying additional parameters. To start imgix will apply auto=enhanceto your asset.

Additionally, if you have crop=faces set and apply auto=true imgix will automatically apply auto=redeye.

auto=format

When auto=format is set, imgix determines whether the image can be served in a better format by a process called automatic content negotiation. It compiles the various signals available to us—including headers, user agents, and image analytics—to select the optimal image format for your user. This format is served back and the image is correctly cached.

The auto=format logic will attempt to serve images in AVIF when supported. When AVIF is not supported, the image will be served as WebP. If the WebP format is not supported, it will serve the file as JPG or PNG.

The fallback logic can be modified by adding auto=compress and/or specifying a fallback format with fm. When used in conjunction with each other, fm takes priority over auto=compress. For example, specifying auto=format&fm=jpg works only as a fallback parameter while auto=compress&fm=jpg functions as an override for the file type set by auto=format. To learn more about auto=format and auto content negotiation, read our tutorial.

Format Precedence Update

Note: fm=mp4 now takes precedence over auto=format when both are specified. This ensures that videos are delivered in MP4 format.

Firefor 66+ warning

Starting with Firefox version 66, auto content negotation will only occur when an image is being rendered on a webpage. It will not occur when opening a single image in the browser.

Safari WebP Rendering Warning

A small percentage of WebP images will not render correctly in IOS 14 & Safari >= 14 due to a systems frameworks issue under WebKit . Because of this, auto=format will return either a JPEG or a PNG in affected Safari versions.

Safari >=16.4 AVIF Support

Prior to September 2024, imgix served WebP images to Safari browsers when auto=format was applied, due to stability concerns. As of September 2024, imgix now serves AVIF images to Safari browsers on version 16.4 or later when auto=format is used.

auto=redeye

When auto=redeye is set, red-eye removal is applied to any detected faces.

No Base64 Variant

This parameter does not accept base64-encoded values. All values must be provided as standard UTF8, url-encoded strings.