How AVIF Encodes and Stores Monochrome Images

This article provides an overview of how monochrome and grayscale imagery is processed, encoded, and packaged within the AV1 Image File Format (AVIF). It covers the native single-channel encoding mechanisms of the underlying AV1 video codec, how color profiles and pixel layouts are structured, and the way the ISO Base Media File Format (ISOBMFF) container encapsulates this data alongside optional auxiliary channels such as alpha transparency.

Native AV1 Monochrome Encoding

Unlike older image formats that simulate grayscale by duplicating identical data across red, green, and blue channels—or populating neutral chroma planes in YUV color spaces—AVIF leverages native monochrome encoding defined in the AV1 video standard.

Within the AV1 bitstream, the sequence header contains a dedicated syntax element named mono_chrome. When this flag is set to 1:

This approach removes all metadata, transform blocks, and residual data associated with color planes, resulting in significant bandwidth and storage savings compared to encoding grayscale content in 4:2:0 or 4:4:4 profiles.

Bit Depth Support

The AV1 monochrome mode directly supports multiple bit depths without requiring format conversion:

The high_bitdepth and twelve_bit flags in the sequence header determine the exact bit depth used for the single encoded luma channel.

Container-Level Storage in ISOBMFF

An AVIF file encapsulates the AV1 bitstream within an ISOBMFF-compliant box structure. For monochrome files, container-level metadata specifically indicates that only a single image channel is present:

Handling Transparency in Monochrome AVIF

When a grayscale image requires transparency, AVIF does not re-enable chroma planes to carry alpha. Instead, it maintains storage efficiency by using an auxiliary image item:

  1. Base Image: Encoded as a pure monochrome AV1 bitstream (representing the grayscale luminance).
  2. Auxiliary Image: Encoded as a secondary, separate monochrome AV1 bitstream containing the alpha matte.
  3. Item Reference Box (iref): Links the auxiliary image to the base image with the reference type auxl (auxiliary list). The aux_type property specifies that the secondary plane acts as an alpha channel (urn:mpeg:mpegB:cicp:systems:auxiliary:alpha).

This architecture allows the image luminance and the transparency mask to be compressed independently using parameters optimal for each channel's content.