To optimize AVIF images, run `npx optimo image.avif`. Optimo applies format-specific ImageMagick-powered compression that typically reduces AVIF file size by 15–40% without visible quality loss. The original file is kept if the output is not smaller.

## Command

Start here. Run optimo on an image file:

```
npx optimo image.avif
```

Tip: add `--dry-run` to preview changes.

## When to use AVIF

- high-volume sites
- photo-heavy pages
- performance budgets

### Trade-offs

- Slower encode
- Some older clients may not support it

## Related formats

[PNG](/content/optimize/png/index.html) - Lossless image format with sharp edges and great support for transparency.
[JPEG](/content/optimize/jpeg/index.html) - The classic photo format: widely supported, good quality-to-size for photographs.
[WebP](/content/optimize/webp/index.html) - Modern image format with great compression and broad browser support.
[HEIC](/content/optimize/heic/index.html) - A common camera output format (especially Apple devices) with efficient compression.
[JPEG XL](/content/optimize/jxl/index.html) - Next-gen image format designed for high quality and efficient compression.
[GIF](/content/optimize/gif/index.html) - Legacy animated image format that is still widely used for simple loops.
[SVG](/content/optimize/svg/index.html) - Vector format: crisp at any size and excellent for icons and illustrations.

## Related conversions

[Convert PNG to AVIF](/content/convert/png-to-avif/index.html)  
[Convert JPEG to AVIF](/content/convert/jpeg-to-avif/index.html)  
[Convert WebP to AVIF](/content/convert/webp-to-avif/index.html)  
[Convert AVIF to PNG](/content/convert/avif-to-png/index.html)  
[Convert AVIF to JPEG](/content/convert/avif-to-jpeg/index.html)  
[Convert AVIF to WebP](/content/convert/avif-to-webp/index.html)  
[Convert AVIF to HEIC](/content/convert/avif-to-heic/index.html)  
[Convert AVIF to JPEG XL](/content/convert/avif-to-jxl/index.html)

## More for AVIF

[Compress AVIF](/content/compress/avif/index.html)  
[Resize AVIF](/content/resize/avif/index.html)  
[What is AVIF?](/content/formats/avif/index.html)

## Compare formats

If you're picking a delivery format, comparisons can help.

[Browse comparisons](/content/compare/index.html)

## Frequently asked questions

**How do I optimize AVIF files?**  
Run "npx optimo image.avif" in your terminal. Optimo applies format-specific ImageMagick-powered compression that reduces AVIF file size while preserving quality. The original file is kept if the optimized output is not smaller.

**Is AVIF optimization lossless?**  
By default, optimo uses lossless optimization for AVIF. For additional compression, add the --lossy flag to allow minor quality trade-offs for significantly smaller files.

**What tools does optimo use for AVIF?**  
Optimo uses ImageMagick, MozJPEG, and SVGO (depending on format) under the hood with format-specific settings tuned for AVIF files.
