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
| Value | Description |
|---|---|
low | Output image quality will be similar to the input image quality. |
medium | More optimization is allowed. We attempt to preserve the visual quality of the input image. |
high | Minor visual artifacts may be visible. This produces the smallest file. |
Notes
- Optimize is currently supported by the following output formats:
JPEG,WebP,AVIF. - If the
qualityparameter is also provided,qualityoverridesoptimizebecause it is more precise. - Because
optimizeattempts 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 usage | Description |
|---|---|
?optimize=medium | Output an image with medium optimization |
?optimize=high&auto=webp | Output a highly optimized JPEG. For browsers that support WebP output a highly optimized WebP image. |