AVIF Parsing: Still Image vs Image Collection
An AVIF parser distinguishes between a single still image and an
image collection by analyzing the structural metadata defined in the ISO
Base Media File Format (ISOBMFF) and the High Efficiency Image File
Format (HEIF) specifications. By inspecting key boxes within the
file—specifically the File Type Box (ftyp), the Meta Box
(meta), the Primary Item Box (pitm), and the
Item Information Box (iinf)—the parser determines whether
the file contains one primary visual item with optional auxiliary data
or multiple independent images meant to be treated as a collection.
1. Evaluating
Brands in the File Type Box (ftyp)
The parser begins at the ftyp box to identify the file's
major and compatible brands:
avif: Indicates support for static AVIF items.avis: Indicates an AVIF image sequence (typically animated content stored across video-style tracks).
While ftyp signals general format support, it does not
fully resolve whether a file contains a single still or an image
collection, as both can share the avif structural brand. To
make this determination, the parser must inspect the structural layout
within the meta box.
2. Inspecting the
Primary Item Box (pitm)
Inside the meta box, the parser checks for the presence
of a Primary Item Box (pitm).
- Single Still Image: The
pitmbox specifies a validitem_IDrepresenting the primary display item (an AV1 image item of typeav01or a derived image such as a grid). - Image Collection: A collection may either omit the
pitmbox entirely (signaling no default master image) or include apitmbox merely to designate a cover/representative image for the broader set. The presence ofpitmalone is not sufficient to confirm a single image; the parser must evaluate how other items relate to it.
3.
Analyzing the Item Information Box (iinf) and Item
Types
The parser inspects the iinf box, which catalogues all
items in the file via Item Info Entry (infe) boxes. The
parser filters items by their item_type:
- Master Image Items: Items with the type
av01(AV1 encoded frames) or derived types likegridoriden. - Auxiliary Items: Non-displayable items such as
alpha transparency channels, depth maps, or gain maps (often denoted by
auxlor associated metadata). - Hidden Items: Items marked with the
item_protection_indexor hidden flags.
If the parser finds only one top-level, non-auxiliary image item, the file is classified as a single still image. If multiple independent master image items exist, the parser looks further to identify their relationships.
4. Resolving Item References
(iref)
To confirm whether multiple items represent a single image or an
image collection, the parser checks the Item Reference Box
(iref):
- Single Still Image Dependencies: Multiple items
often compose a single image. For instance, an alpha channel references
the master image with an
auxlreference type, or a thumbnail references it with athmbreference type. Derived images (such as a tiledgrid) will reference multiple sub-image tiles through adimg(derived image) reference. Because these items depend on or support a single output canvas, the parser treats the entire structure as a single still image. - Image Collection: If multiple independent master image items exist that are not consumed by a derived image (like a grid) and are not auxiliary references (like alpha or thumbnails), the parser identifies the file as an image collection. In this scenario, each master item represents an autonomous image.
5. Meta Items vs. Movie
Tracks (moov)
The parser checks if the file uses track-based storage via a Movie
Box (moov):
- Item-based (Meta Box): AVIF still images and static
image collections reside exclusively in the
metabox as individual items. - Track-based (Movie Box): If visual data is packaged
in tracks (
trak), the file is categorized as an image sequence (animation) rather than a static collection.