AVIF Full vs Limited Range Color Quantization

This article explains how the AVIF image format supports both full-range and limited-range color quantization configurations through metadata signaling at both the container and bitstream levels. By accommodating both standards, AVIF enables consistent color reproduction across computer graphics, photography, and video workflows while preventing common display issues such as crushed blacks, clipped highlights, or washed-out contrast.

Understanding Full-Range and Limited-Range Quantization

Color range—often referred to as quantization range—defines the span of numerical code values used to represent luminance (Y) and chrominance (Cb/Cr or RGB) channels.

AV1 Bitstream Level Signaling

AVIF uses the AV1 video compression format for its image data. Within the AV1 bitstream, color quantization range is explicitly declared inside the Sequence Header Open Bitstream Unit (OBU), specifically within the color_config() syntax structure.

The bitstream utilizes a single-bit field designated as color_range:

When the AV1 decoder parses the sequence header, this flag instructs the decoding pipeline whether the decoded samples must be normalized using studio bounds or mapped directly across the full numerical range. For RGB encoded streams, the AV1 specification requires color_range to be set to 1, while YUV streams can be configured as either 0 or 1 depending on the source material.

HEIF/ISOBMFF Container Signaling

AVIF files package AV1 bitstreams into an ISOBMFF (ISO Base Media File Format) container defined by the HEIF standard. Range signaling also takes place at this container level via the Colour Information Box (colr) associated with the primary image item.

The container uses the nclx (on-screen color properties) color type box, which contains:

Container-level signaling allows image parsers, web browsers, and operating system decoders to query the image’s color range without having to initialize and parse the underlying AV1 video bitstream.

Precedence and Decoder Handling

To maintain specification compliance, the full_range_flag in the container's colr box must match the color_range flag within the AV1 sequence header.

If a discrepancy occurs between the container metadata and the bitstream:

  1. Direct Decoders: Low-level AV1 decoders prioritize the bitstream's internal color_range flag to perform sample reconstruction.
  2. System Renderers: High-level graphics APIs and browser pipelines often rely on the container-level colr box to set up display swap chains and hardware color management transformations before sending pixels to the screen.

Proper synchronization of these flags ensures that AVIF files extracted directly from video frames (typically limited range) retain their exact broadcast-standard color values, while native digital stills (typically full range) utilize the maximum available dynamic range of the display device.