optimize

The optimize parameter automatically applies optimal quality compression to produce an output image with as much visual fidelity as possible, while minimizing the file size.

Syntax

optimize={value}

Allowed values

ValueDescription
lowOutput image quality will be similar to the input image quality.
mediumMore optimization is allowed. We attempt to preserve the visual quality of the input image.
highMinor visual artifacts may be visible. This produces the smallest file.

Notes

  1. Optimize is currently supported by the following output formats: JPEG, WebP, AVIF.
  2. If the quality parameter is also provided, quality overrides optimize because it is more precise.
  3. Because optimize attempts to produce an output image with as much visual quality as possible while minimizing the file size, the operations applied are subject to change.

Examples

Click the links to view the transformed image using a demo Fastly IO service.

Example usageDescription
?optimize=mediumOutput an image with medium optimization
?optimize=high&auto=webpOutput a highly optimized JPEG. For browsers that support WebP output a highly optimized WebP image.

User contributed notes

BETA

Do you see an error in this page? Do you have an interesting use case, example or edge case people should know about? Share your knowledge and help people who are reading this page! (Comments are moderated; for support, please contact Fastly support)