Chaining Transformation Boxes in AVIF Files
AVIF files, built upon the ISO Base Media File Format (ISOBMFF) and the High Efficiency Image File Format (HEIF) standards, fully support combining multiple transformation boxes for a single image item. This article explains how the underlying file architecture chains transformative properties, how execution order is determined, and the specific constraints imposed by the AVIF specification.
The Container
Architecture: ipco and ipma
In an AVIF file, image metadata and instructions are decoupled from
the compressed AV1 bitstream. This is handled within the Meta Box
(meta) through two primary structures:
ipco(Item Property Container Box): Defines and stores individual properties, including both descriptive properties (such as color profiles) and transformative properties (such as rotation).ipma(Item Property Association Box): Maps properties declared in theipcoto specific image items by referencing their index values.
Because an item can be associated with multiple properties
simultaneously within the ipma, it can reference multiple
transformative operations.
Transformative Properties Supported in AVIF
AVIF inherits several standard transformative property boxes from HEIF and the Multi-Image Application Format (MIAF):
irot(Image Rotation): Rotates the image anti-clockwise by 90, 180, or 270 degrees.imir(Image Mirroring): Horizontally or vertically flips the image.clap(Clean Aperture): Crops the image to a defined rectangle before display.
How Transformation Chaining Works
Transformation boxes do not alter the raw encoded bitstream. Instead, they provide rendering instructions applied sequentially after the AV1 payload is decoded into pixel data.
When multiple transformative properties are associated with a single
item, they are applied strictly in the order they appear in the
ipma entry for that item. For example, associating an
imir property followed by an irot property
requires the decoder to mirror the decoded frame first and then rotate
the resulting image. Reversing that sequence in the ipma
changes the final rendered orientation.
Standard Constraints and Limitations
While chaining is fully supported, the AVIF specification (via its adherence to the MIAF profile) enforces strict rules to prevent ambiguous rendering:
- Uniqueness per Type: Under the MIAF baseline, an
item cannot have duplicate instances of the same transformation type.
You cannot chain two
irotboxes together; multiple rotations must be consolidated into a singleirotinstruction. - Order Dependency: The order of indices in the
ipmabox is critical. Compliant decoders process transformations sequentially as listed. - Derived Items: For highly complex workflows involving operations beyond simple orientation and cropping, AVIF allows the creation of "derived items" (such as grid items or identity items), which can chain transformations across multiple hierarchical steps rather than relying solely on a single item property association list.
AVIF files successfully chain multiple transformation boxes to manipulate a single item, provided the boxes are valid, unique per transformation type, and referenced in the desired sequential order within the association table.