What Is an AVIF Grid Image and How It Works

An AVIF grid image is a specialized construct within the AV1 Image File Format that combines multiple smaller, independently encoded image tiles into a single visual canvas. This article explains the technical foundation of AVIF grid images, examines the role of the underlying High Efficiency Image File Format (HEIF) structure, and details the step-by-step process decoders use to assemble individual image items into a complete, high-resolution picture.

What Is an AVIF Grid Image?

An AVIF grid image is a derived image item that allows a large image to be segmented into a matrix of smaller rectangular tiles. AVIF leverages the container specifications of ISO/IEC 23008-12 (HEIF). Under this specification, an image does not have to be stored as a single, monolithic compressed bitstream. Instead, an image can be represented as a collection of separate items referenced by a primary "grid" descriptor.

This tiling approach serves two main technical purposes:

  1. Overcoming Decoder Hardware Limits: Many hardware AV1 decoders have maximum resolution limitations, such as 4K (3840×2160) or 8K. By dividing an ultra-high-resolution image into tiles smaller than the hardware threshold, devices can decode massive images using hardware acceleration rather than relying on slower software fallbacks.
  2. Parallel Encoding and Decoding: Multiple CPU or GPU cores can encode or decode individual tiles simultaneously, significantly reducing processing latency.

Key Components of a Grid Image

In an AVIF file, image data and structural metadata are stored within the meta box (fourcc: 'meta'). A grid image relies on three main components inside this container:

How the Grid Image Is Assembled

The assembly of an AVIF grid image follows a precise sequence defined by the HEIF and AVIF specifications.

1. Defining the Grid Configuration

The grid item contains a small payload of configuration bytes that define the structure of the output canvas. This payload specifies:

2. Referencing the Tile Items

To connect the configuration to the actual image data, the file includes an Item Reference Box (iref). Inside this box, an entry with the reference type dimg (derived image) designates the grid item as the parent and lists the identifiers of the input tiles as children.

The order of the tile references inside the dimg entry is critical. The HEIF specification dictates that tiles must be listed in row-major order: from left to right, top to bottom. For a 2×2 grid, the items must appear in the reference list as:

  1. Top-left tile
  2. Top-right tile
  3. Bottom-left tile
  4. Bottom-right tile

3. Decoding and Canvas Placement

When an AVIF decoder processes a grid image, it executes the following steps:

  1. Parse Metadata: The decoder identifies the primary item as a grid type and reads the row count, column count, and target canvas dimensions.
  2. Initialize Canvas: A blank canvas is allocated matching the specified output width and height.
  3. Decode Tiles: The decoder retrieves the bitstream for each referenced av01 item and decodes the pixels. This can occur sequentially or in parallel.
  4. Positioning: Tiles are placed onto the canvas according to their position in the reference list. All tiles in a row must share the same height, and all tiles in a column must share the same width, ensuring clean alignment along shared boundaries.
  5. Cropping and Final Output: Because individual tiles are often encoded in fixed block dimensions (such as multiples of 64 or 128 pixels), the combined size of the tiles may slightly exceed the intended image dimensions. The decoder crops any excess pixels extending beyond the defined output width and height, presenting the user with the final, seamless image.