How AVIF Transforms Images Without Re-Encoding

The AV1 Image File Format (AVIF) enables lossless geometric transformations—such as cropping, rotating, and flipping—without touching or re-encoding the compressed image bitstream. This is achieved by separating the raw AV1 video bitstream from the container's structural metadata, utilizing the ISO Base Media File Format (ISOBMFF) architecture. Instead of decoding pixels, applying changes, and recompressing the data (which introduces generational loss and consumes significant CPU cycles), AVIF applies these adjustments via lightweight metadata boxes that instruct the decoder's rendering pipeline how to display the image.

The Decoupled Architecture of AVIF

AVIF files consist of two primary layers:

  1. The Media Data Box (mdat): Contains the raw, compressed AV1 Open Bitstream Units (OBUs). This payload represents the original encoded pixel data.
  2. The Metadata Box (meta): Holds descriptive and structural information about the image items, color profiles, and presentation instructions.

Because the underlying AV1 bitstream is encapsulated as an independent item within the container, the file format treats image modifications as presentation instructions rather than modifications to the compressed data itself.

Transformative Item Properties

ISOBMFF defines specific "transformative properties" stored inside the Item Property Container Box (ipco). These properties are linked to the primary image item using the Item Property Association Box (ipma). The three main transformative properties supported in AVIF are:

Because these instructions reside exclusively in the ipco box, editing an image involves writing only a few bytes of metadata to update or append these properties.

The Decoder Execution Pipeline

When an AVIF-compliant parser and decoder process an image with container transformations, the workflow occurs in two distinct stages:

  1. Bitstream Reconstruction: The AV1 decoder reads the compressed payload directly from the mdat box and reconstructs the full-resolution pixel buffer as it was originally authored.
  2. Post-Decode Transform: The presentation layer evaluates the associated ipma entries in a strict order defined by the specification. The operations (e.g., crop via clap, rotate via irot) are executed directly on the in-memory uncompressed frame buffer prior to rendering on screen.

Advantages Over Traditional Bitstream Re-encoding