AVIF is becoming a default choice for web images

AVIF is increasingly common on the web, and with good reason: support is now nearly universal across browsers. Since Chrome added stable support, AVIF usage in that browser alone grew to roughly one percent within about a year — a significant uptick for a new image format.

A line graph of AVIF usage in Chrome from May 2021 to March 2023. Support has steadily grown from 0% to just beneath 1.4%.

The format's adoption extends well beyond browsers. Image CDNs including Akamai, Cloudflare, Cloudinary and Imgix all serve AVIF today. Imgix reported file size savings of 60 percent compared to JPEG and 35 percent compared to WebP when it announced AVIF support. Those savings translate directly into faster page loads, particularly for Largest Contentful Paint (LCP), a Core Web Vitals metric that measures how quickly the largest content block on a page renders. For developers wanting to quantify potential gains, Lighthouse includes an audit that estimates how much AVIF could reduce image payload on a given site.

On the publishing side, WordPress — the world's most widely used website platform — has several plugins for converting images to AVIF, including AutoOptimize, Converter for Media, EWWW Image Optimizer, Optimole and ShortPixel Image Optimizer. Command-line users can turn to ImageMagick or FFmpeg.

Encoding performance has caught up

Fast encoding and good visual quality are prerequisites for compressing images at scale. AVIF software encoders have improved markedly in the past two years. The format produces smaller files at similar visual quality than other modern still image formats, and it can now encode faster as well.

A bar chart comparing various image codec file sizes as a percentage of the output of TurboJPEG. AVIF is lowest, then JPEG XL, then WebP, and finally MozJPEG.

Multi-threaded encoding closes much of the gap with older codecs like WebP, whose simpler — and less efficient — compression algorithms had given them an encoding speed edge. AVIF now achieves comparable speed for common use cases while delivering meaningfully better compression.

A comparison of image codec encoding speed. The compared encoders are average AVIF, average JPEG XL, average WebP (one thread), and average MozJPEG (one thread). AVIF is generally one of the fastest image encoders in terms of best quality and default effort, but is the slowest of all encoders for on-the-fly performance.

Reproducible benchmarks, including encoding speed and visual quality comparisons, are available on the Image Coding Comparisons site. Software encoders are optimized for x86 and ARM architectures, but compressing very large image libraries remains computationally expensive. Hardware acceleration offers one way to reduce that cost. Bluedot's Pulsar-AVIF encoder runs on programmable FPGAs such as AMD's Alveo U250 and reports a 7 to 23 times speed improvement over software avifenc with comparable compression efficiency. It can be deployed on cloud instances such as Azure NP-Series virtual machines.

Encoder Encode time (ms) Frames per second CPU utilization Hardware specification
Pulsar-AVIF
(FPGA)
60 409.85 305% AMD Alveo U250 1ea + Intel(R) Xeon(R)
Platinum 8171 CPU at 2.6GHz, 10 cores
avifenc
(libaom)
405 59.26 3200% Intel(R) Xeon(R) Platinum 8370C CPU at
2.8GHz, 32 cores
avifenc
(SVT-AV1)
1325 18.11 3200% Intel(R) Xeon(R) Platinum 8370C CPU at
2.8GHz, 32 cores
AVIF encode speed comparison
  • Test set: Kodak (24 images of 768x512)
  • Encoding 24 images simultaneously (24 processes)
  • Each software encoding process is executed with 4 threads. (-j 4)

Animated AVIF: a practical GIF replacement

Animated GIF remains popular for short animations even at 35 years old, but its limitations are well known: a 256-color palette and weak compression produce large files and cap useful resolution and frame rate. Animated AVIF uses the same coding scheme as AV1 video, which makes it dramatically more efficient than GIF.

In a benchmark encoding a set of animated GIFs to both AVIF and JPEG XL, median file size savings were approximately 86 percent versus the original GIFs and about 73 percent versus animated JPEG XL files. Chrome, Firefox and Safari all support animated AVIF playback.

A comparison of animated image codec performance. AVIF outperforms GIF and JPEG XL in terms of both average and median file size.
* libavif and libjxl versions: libavif version 4cff6a3 (libaom version v3.5.0), libjxl version 176b1c03. Test set: 15 sample GIFs from Wikipedia.

FFmpeg can convert GIF to AVIF directly. The $CRF parameter controls output quality on a scale of 0 to 63, with lower values giving better quality and larger files; 0 is lossless. A starting value of 23 is a reasonable choice for small animated files.

ffmpeg -i "$INPUT_GIF" -crf $CRF -b:v 0 "$OUTPUT.avif"

FFmpeg defaults to the libaom encoder for AVIF but can use rav1e or SVT-AV1 when they are available; the AV1 encoding guide covers encoder selection and speed/quality tuning.

Another use case is repackaging an existing AV1 video into AVIF without re-encoding it, using the -c:v copy flag. This is far cheaper than a full decode/encode cycle and makes the content usable in an <img> element.

ffmpeg -i "$INPUT_AV1_VIDEO" -c:v copy -an "$OUTPUT.avif"

AVIF's trajectory is clear: browser support is effectively universal, CDNs serve it at scale, and content platforms and encoding tools have built in support. It offers the best quality-per-byte among widely supported formats, and animated AVIF is the most efficient way to deliver animations on the web. For teams with questions or feature requests, the av1-discuss mailing list, AOM GitHub community and AVIF wiki are the places to go.