Introduction
AVIF is an image format from the Alliance for Open Media, published in 2019. It stores images compressed with AV1, a royalty-free video codec, inside the same HEIF container that HEIC uses.
It supports lossy and lossless compression, alpha transparency, high bit depths, wide colour and HDR, and animated image sequences. All the major web browsers can display it, and it is used on the web as a smaller alternative to JPEG and WebP.
Structure
An AVIF file is a HEIF file made of ISO base media boxes, each a 4-byte big-endian
size, a 4-byte type and its contents. It starts with an ftyp box (the text
ftyp at offset 4) whose brand is avif for still images or
avis for image sequences.
A meta box lists the image items and their properties, including an
av1C box with the AV1 codec settings. Transparency is a separate
greyscale image linked to the main one as an auxiliary item. The coded AV1 data sits
in an mdat box.
0ftyp brandaviforavis, compatible brandsvaries…meta primary item, item info, locations, propertiesvaries…mdat the AV1-coded image datavaries
In this reference
- Brands and items – brands, profiles, the AV1 image item and its OBUs, alpha, depth, sequences and gain maps
- Item properties – the av1C record bit by bit, operating points, layers and the AVIF rules for HEIF properties
- HEIF boxes and items – the box layout AVIF shares with HEIC: meta, item information, locations, references
Not described
The pages follow the AVIF v1.2.0 specification and the AV1-ISOBMFF binding. AVIF shares its boxes with HEIC, so the gaps there apply here too.
Known, not yet covered
- Reference: the AV1 bitstream itself is only touched: the OBU header fields, OBU type numbers,
seq_profilecoverage and the level index formula were written from memory of the AV1 bitstream specification, which is free, and were not re-read (items). - Reference: the
satosample transform operator list, thecclv,amve,reveandndwtboxes, and the ISO 21496-1 gain map format thattmapitems rely on (properties). ISO 21496-1 is a paid standard. - Reference: the rules that come from HEIF (ISO/IEC 23008-12, paywalled) are only as exact as the AVIF text repeats them.
- Viewer: there is no AVIF plugin yet; decoding needs an AV1 decoder.
Unknown
- Reference: which colour applies when a file has no
colrproperty: AVIF 1.2.0 does not say.
Links
Software
- Google Chrome – web browser that displays AVIF (Windows, macOS, Linux, mobile)
- Firefox – web browser that displays AVIF (Windows, macOS, Linux, mobile)
- Safari – Apple’s web browser, which displays AVIF (macOS, iOS)
- GIMP – free image editor that opens and exports AVIF (Windows, macOS, Linux)
- Squoosh – Google’s image compressor that runs in the browser and saves AVIF (web)
- XnView MP – image viewer and batch converter (Windows, macOS, Linux)
- ImageMagick – command-line tools that convert to and from AVIF (Windows, macOS, Linux)
Developers
Reference
- AV1 Image File Format (AVIF) specification – the Alliance for Open Media specification
- AV1 codec ISO media file format binding – how AV1 is stored in ISO media boxes, including the av1C record
- AV1 bitstream specification – the codec itself: OBUs, sequence headers and decoding