Ch. 4 · Image Codecs

한국어日本語
7 min

AVIF vs HEIC vs JPEG: How Video Codecs Became Image Formats

HEIC and AVIF reuse the intra-frame tools of HEVC and AV1 for still images, producing files about half the size of JPEG. Here is why, and why AVIF wins on the web.

Everything in this chapter comes together here. Video codecs' intra-frame tools have advanced far beyond JPEG, so why not use them to compress a single still image? That idea gave us HEIF and AVIF.

FormatUnderlying codecReleasedNotes
HEIC/HEIFHEVC intra frame2015 (adopted by Apple in 2017)Default photo format on iPhone
AVIFAV1 intra frame2019Royalty-free, led by Google and Netflix
JPEG XLNew design (Modular + VarDCT)2021Supports lossless recompression of JPEG
Why the compression is so good

Everything you learned in Chapter 3 applies directly — variable block partitioning (not JPEG's fixed 8×8, but up to 64×64 in HEVC and up to 128×128 in AV1, depending on the content), dozens of intra prediction modes (JPEG has only the DC difference), sophisticated entropy coding based on arithmetic coding such as CABAC (far more efficient than JPEG's simple Huffman), and in-loop filters (JPEG has none at all). As a result, AVIF is known to produce files that are on average 40–50% smaller than JPEG at the same quality.

JPEG 100% HEIC ~60% AVIF ~50%
File size at the same quality (conceptual diagram — actual ratios vary with content)

HEIF/AVIF are also 'containers'

HEIF and AVIF are not just image formats but containers (a concept covered in detail in Chapter 10). That makes the following possible.

  • Burst shots / image sequences — several images stored together in one file.
  • Depth maps and alpha channels — the background-blur information for Portrait mode is stored alongside the image.
  • HDR still images — the PQ/HLG from Chapter 1 applied to images as well.
  • Animation (AVIF) — efficient animation that can replace GIF.
In practice — why AVIF has the edge on the web

HEIC is based on HEVC and so carries patent royalties, which makes the browser camp (Chrome, Firefox) reluctant. AVIF is based on AV1 and is royalty-free (a core principle of AOMedia, covered in Chapter 7), so it spread much faster as a web standard. iOS uses a dual strategy: HEIC for capture, and AVIF support for the web. It is a good example of how codec choice is tied up not just with pure technology but with patent and business issues — a theme you will keep meeting in Chapters 5–8.

HEIC/HEIFHEIC/HEIF

An image container based on HEVC intra frames. Adopted by Apple as its default.

AVIFAVIF

A royalty-free image format based on AV1 intra frames.

JPEG XLJPEG XL

A next-generation image format combining the Modular transform and VarDCT. Supports lossless JPEG recompression.

Check yourself

What is the main reason AVIF has been adopted more widely than HEIC in web browsers?

Check yourself

What is the fundamental reason HEIC/AVIF files are much smaller than JPEG at the same quality?