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.

  • Full Range (PC Range): Uses the complete mathematical scale available at a given bit depth. For an 8-bit image, values span from 0 to 255. For a 10-bit image, values span from 0 to 1023. This is standard for digital photography, computer monitors, and web graphics to maximize dynamic range and color precision.
  • Limited Range (Studio/TV Range): Reserves headroom and footroom at the extremes of the spectrum, originating from legacy analog broadcast requirements. In standard 8-bit limited-range video, luminance spans from code values 16 to 235, while chrominance spans from 16 to 240. In 10-bit, luminance spans from 64 to 940.

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:

  • color_range = 1: Specifies full-range quantization.
  • color_range = 0: Specifies limited-range quantization.

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:

  • Colour Primaries: Identifies the chromaticity coordinates (e.g., BT.709, BT.2020).
  • Transfer Characteristics: Identifies the opto-electronic transfer function (e.g., sRGB, PQ, HLG).
  • Matrix Coefficients: Identifies the derivation of luma and chroma signals (e.g., BT.709, BT.2020 non-constant luminance).
  • Full Range Flag (full_range_flag): A 1-bit flag where 1 designates full range and 0 designates limited range.

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.