Everyone talks about how small AVIF files are.
Almost nobody talks about what it costs to generate them in production.
I run a free image converter built on Rust + libvips. After processing thousands of conversions, here are the numbers that changed how I think about format choice.
The compression story you already know
AVIF beats WebP on file size. For photos and gradients:
AVIF saves ~50% vs JPEG (median across 600 photos)
WebP saves ~31% vs JPEG
At the same DSSIM score, AVIF produces files ~50% smaller than WebP
Real and impressive. But that's only half the equation.
The encoding cost nobody talks about
Here's what actually happens when you encode with libaom (the default AVIF encoder):
Format Encoding time (1080p) Peak CPU Peak RAM
WebP ~90ms ~20% ~200MB
AVIF (libaom, default settings) 1–4 seconds ~400% (4 cores) ~2.5GB
AVIF (maximum quality) up to 48 seconds - -
In my tests, AVIF encoding with libaom was up to 47× slower than WebP at comparable quality settings.…