AVIF Image Format: AV1-Powered Next-Generation Compression
AVIF (AV1 Image File Format) is a modern image format based on the AV1 video codec's intra-frame encoding, standardized by the Alliance for Open Media (AOM) in 2019. It delivers exceptional compression efficiency — typically 40–50% smaller than JPEG at equivalent visual quality — while supporting HDR, wide color gamut, 12-bit color depth, and alpha transparency. With browser support exceeding 95% globally, AVIF has become the highest-compression choice for web image delivery.
Technical Foundation: AV1 Intra-Frame Coding
AVIF uses the HEIF container (ISO/IEC 23008-12, High Efficiency Image File Format — the same container as HEIC/HEIF used by Apple) with AV1 intra-frame compression. The compression pipeline:
-
Color space and chroma subsampling:
- YCbCr color space conversion (same approach as JPEG and HEVC)
- Supports 4:2:0, 4:2:2, and 4:4:4 chroma subsampling
- 4:4:4 (full chroma) is often used for high-quality web images to avoid color bleeding
-
Tiling: For large images or parallel encoding, the image is divided into tiles (power-of-2 dimensions). Each tile is encoded independently using AV1 intra prediction.
-
Intra prediction: 56 directional/smooth prediction modes predict each coding unit's values from already-decoded neighbors, generating a residual that requires fewer bits.
-
Transform: The residual is transformed using DCT or ADST (Asymmetric Discrete Sine Transform), with the transform type selected per coding unit for optimal efficiency.
-
Quantization: Transform coefficients are quantized (controlled by the quality parameter). AV1's quantization matrix can differentiate quantization strength between luma and chroma channels.
-
Loop restoration: Wiener filter + constrained directional enhancement filter (CDEF) smooth out block artifacts after decoding.
-
Entropy coding: Asymmetric Numeral Systems (ANS) — more efficient than CABAC used by HEVC.
The result: AVIF achieves compression ratios impossible with JPEG at the same perceptual quality, particularly at low-to-medium quality settings where JPEG shows heavy blocking and ringing artifacts.
HEIF Container Structure
AVIF uses the HEIF/ISOBMFF container:
[ftyp] File Type Box
major_brand: 'avif'
compatible_brands: ['avif', 'mif1', 'miaf', 'MA1B' or 'MA1A']
[meta] Metadata Box
[hdlr] Handler: 'pict'
[pitm] Primary Item: item_ID=1
[iinf] Item Info:
[infe] Item Info Entry: item_ID=1, type='av01' (AV1 image)
[infe] Item Info Entry: item_ID=2, type='Exif' (EXIF metadata)
[iprp] Item Properties:
[ispe] Image Spatial Extents: width, height
[av1C] AV1 Codec Configuration Record
[colr] Color: nclx or prof (ICC profile)
[pixi] Pixel Information: bits per channel
[idat] or [mdat] Item/Media Data: AV1 bitstream
[mdat] Media Data Box (AV1 compressed image data)
For animated AVIF, a sequence of AV1 frames is stored similarly to HEIF image sequences.
AVIF Features Matrix
| Feature | AVIF | JPEG | WebP | PNG | HEIC |
|---|---|---|---|---|---|
| Lossy compression | ✅ | ✅ | ✅ | ❌ | ✅ |
| Lossless compression | ✅ | ❌ | ✅ | ✅ | ✅ |
| Alpha transparency | ✅ | ❌ | ✅ | ✅ | ✅ |
| Animation | ✅ | ❌ | ✅ | ❌ (APNG) | ✅ |
| HDR (10-bit+) | ✅ | ❌ | ❌ | ❌ (8-bit) | ✅ |
| Wide color gamut | ✅ (P3, BT.2020) | Limited | ❌ | ❌ | ✅ |
| 12-bit color | ✅ | ❌ | ❌ | ✅ | ✅ |
| EXIF/XMP metadata | ✅ | ✅ | ✅ | ✅ | ✅ |
| Browser support (2024) | ~95% | ~100% | ~97% | ~100% | Limited |
| Royalty-free | ✅ | ✅ | ✅ | ✅ | ❌ (HEVC patents) |
Browser and Platform Support
- Chrome: 85+ (Aug 2020)
- Firefox: 93+ (Oct 2021)
- Safari: 16+ (Sep 2022) — partial; AVIF animated not yet supported in Safari
- Edge: 121+ (Jan 2024) full support
- iOS Safari: 16+ (Sep 2022)
Notable exceptions: Internet Explorer (dead), older Safari versions, some embedded browsers. The <picture> element with AVIF + WebP + JPEG/PNG fallback covers all cases:
<picture>
<source srcset="image.avif" type="image/avif">
<source srcset="image.webp" type="image/webp">
<img src="image.jpg" alt="Description" width="800" height="600">
</picture>
Encoding AVIF
avifenc (reference encoder from libavif)
# Basic lossy encoding (quality 0=worst, 100=best, default ~60)
avifenc --quality 60 --speed 6 input.jpg output.avif
# High quality (equivalent to JPEG ~90)
avifenc --quality 80 --speed 4 input.jpg output.avif
# Lossless encoding
avifenc --lossless --speed 6 input.png output_lossless.avif
# 10-bit HDR encoding
avifenc --quality 70 --depth 10 --cicp 9/16/9 input_hdr.png output_hdr.avif
# 4:4:4 chroma (avoids color bleed in text/graphics)
avifenc --quality 80 --yuv 444 input.png output_444.avif
# Animated AVIF from video
ffmpeg -i input.mp4 -vf "fps=15,scale=480:-1" frames/frame%04d.png
avifenc --fps 15 frames/frame*.png output.avif
ffmpeg
# Basic AVIF encoding
ffmpeg -i input.jpg -c:v libaom-av1 -still-picture 1 -crf 30 output.avif
# High quality
ffmpeg -i input.jpg -c:v libaom-av1 -still-picture 1 -crf 18 -cpu-used 4 output.avif
# With SVT-AV1 (much faster encoding)
ffmpeg -i input.jpg -c:v libsvtav1 -still-picture 1 -crf 30 output.avif
ImageMagick
# Convert to AVIF
convert input.jpg -quality 80 output.avif
# Batch convert JPEGs to AVIF
mogrify -format avif -quality 70 *.jpg
sharp (Node.js)
const sharp = require('sharp');
// High quality AVIF
await sharp('input.jpg')
.avif({ quality: 80, speed: 4 })
.toFile('output.avif');
// Lossless AVIF
await sharp('input.png')
.avif({ lossless: true })
.toFile('output_lossless.avif');
Quality vs. File Size Reference
Comparing AVIF quality to JPEG (using SSIM perceptual quality metric):
| AVIF Quality | Equivalent JPEG Quality | File Size vs. JPEG |
|---|---|---|
| 80 | ~95 | ~55% smaller |
| 70 | ~90 | ~50% smaller |
| 60 | ~85 | ~45% smaller |
| 50 | ~80 | ~40% smaller |
These ratios vary significantly by image content. Photos with gradients and complex textures show the largest improvements; already-compressed JPEGs show smaller gains.
AVIF Limitations
-
Encoding speed: libaom-av1 (the reference encoder) is extremely slow — encoding a single high-resolution image can take 30–60 seconds. SVT-AV1 is 5–10× faster but slightly lower quality.
-
Decoding speed: AVIF decoding is slower than JPEG and WebP but comparable to HEIC. Hardware decoders are increasingly available (Apple M1/M2 chips, Android Tensor chips).
-
Safari animated AVIF: Safari on macOS/iOS does not yet support animated AVIF (as of 2024).
-
Tooling: Not all image processing tools support AVIF. GIMP 2.10+ supports it; Photoshop requires a plugin.
-
Metadata handling: Some tools strip ICC profiles or EXIF when converting to AVIF — always verify with
exiftool output.avif.
Summary
AVIF represents the current frontier of lossy web image compression. Its AV1-based compression achieves 40–50% smaller files than JPEG at equivalent quality, while supporting HDR, wide color gamut, 12-bit depth, alpha transparency, and animation. Encoding speed remains the primary barrier — for production pipelines, SVT-AV1 or cloud-based encoding services address this. With 95%+ browser support and adoption by Netflix, Facebook, and all major CDNs, AVIF is the format of choice for high-performance web image delivery when compression efficiency is the priority.
Related conversions
Common video conversions that pair well with this guide: