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.

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 applies best-effort techniques to reduce image file size. This includes setting the quality standard (q) to 45, stripping embedded metadata, and performing transparency detection to select the output format: images with transparency are served as PNG, and all others are served as JPEG.

When auto=compress is combined with auto=format (e.g. auto=compress,format), auto=format’s content negotiation takes priority over auto=compress’s format selection. In this combined case, images will be served in AVIF whenever possible, falling back to WebP, then PNG8 (for images with transparency) or JPEG. Compression is still applied.

Note: The default quality standard can be overridden by using the q parameter.

Note: On non-animated images, auto=compress overrides some fm values and serves a JPEG instead: fm=png, fm=png8, and fm=png32 when the image has no transparency, and fm=gif in all cases (transparency is not preserved). Other fm values, such as jpg, webp, and avif, are honored.

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 will 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 auto=format is set, fm only sets the fallback format for browsers that don’t support AVIF or WebP, whether or not auto=compress is also set. For example, auto=format&fm=jpg and auto=format,compress&fm=jpg both serve AVIF to browsers that support it, and JPEG to browsers that support neither AVIF nor WebP. To learn more about auto=format and auto content negotiation, read our tutorial.

Note that AVIF’s file size savings are a statistical average across requests, not a per-image guarantee. See A Developer’s Guide to Understanding Image Types for more detail.

Format Precedence Update

The following fm values take precedence over auto=format when both are specified:

  • fm=mp4: Takes precedence over auto=format when both are specified. This ensures that videos are delivered in MP4 format.
  • fm=pdf: When used on a PDF file, fm=pdf will serve the original PDF file, ignoring all other parameters, including auto=format

Firefox 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 >=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.

Animated GIFs with Transparency on Safari

When auto=format is used with animated GIFs that contain transparency, Safari 16.4 and later may render them incorrectly. Because Safari reports AVIF support, Imgix will serve the GIF as AVIF — a format that does not preserve GIF-style animation with transparency.

To avoid this issue, consider one of the following workarounds:

  • Remove auto=format from GIF requests in your application logic.
  • Use a separate Imgix source without auto=format for serving GIFs.

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.