How AVIF Handles Non-Destructive Edits and Rotation

The AV1 Image File Format (AVIF) enables non-destructive edits—such as rotation, mirroring, and cropping—by storing transformation instructions as metadata properties within its container rather than modifying the underlying compressed AV1 pixel data. This article explains the underlying container architecture, the specific property boxes used for transformations, and the performance and quality advantages of this approach.

The Container Architecture: ISOBMFF

AVIF uses the ISO Base Media File Format (ISOBMFF), standardizing it under the High Efficiency Image File Format (HEIF) specification (ISO/IEC 23000-12). In this framework, the raw image data (the AV1 bitstream) is separated from how that data is presented.

When an AVIF file is created or modified, edits are attached as descriptive item properties in the file's iprp (Item Properties) box. Because the encoded AV1 pixel stream remains untouched, users can repeatedly apply, modify, or remove edits without causing generation loss or recompression artifacts.

Handling Image Rotation: The irot Box

Instead of decompressing the AV1 bitstream, rotating the pixel grid, and re-encoding it, AVIF handles rotation through an irot (Image Rotation) property box.

Handling Mirroring: The imir Box

Flipping an image is similarly handled through an imir (Image Mirror) property box.

Handling Cropping: The clap Box

AVIF manages non-destructive cropping using the clap (Clean Aperture) property box.

Advantages of Non-Destructive Container Edits

  1. Zero Generational Loss: Traditional lossy image formats lose quality each time an edit requires re-encoding. AVIF preserves the original compression quality indefinitely.
  2. Instant Execution: Modifying a byte in a header property takes milliseconds and minimal computing power compared to decompressing and re-encoding complex AV1 video frames.
  3. Reversibility: Because the original pixel payload remains unchanged, any software with write access to the ISOBMFF metadata can revert transformations to restore the original capture.