---
title: optimize
summary: null
url: https://www.fastly.com/documentation/reference/io/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

```text
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

1. Optimize is currently supported by the following output formats: `JPEG`, `WebP`, `AVIF`.
2. If the [`quality`](https://www.fastly.com/documentation/reference/io/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 usage                                                                         | Description                                                                                          |
| ------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- |
| [`?optimize=medium`](https://www.fastly.io/image.jpg?optimize=medium)                 | Output an image with medium optimization                                                             |
| [`?optimize=high&auto=webp`](https://www.fastly.io/image.jpg?optimize=high&auto=webp) | Output a highly optimized JPEG. For browsers that support WebP output a highly optimized WebP image. |
