Maximum AVIF Resolution Supported by libavif

This article explains the maximum image resolution that the libavif library can encode. It covers the technical limits defined by the AV1 video standard, how AVIF grid containers can bypass these limitations, and the practical hardware constraints that affect real-world encoding.

The Absolute Limit for a Single Image

The maximum resolution that libavif can encode into a single, non-tiled image is 65,536 x 65,536 pixels (approximately 4.29 gigapixels).

This limit is inherited directly from the AV1 video codec specification, which serves as the foundation for the AVIF container format. The AV1 bitstream syntax allocates 16 bits for representing both image width and image height, establishing an absolute hardware-coded coordinate boundary of \(2^{16}\) pixels in either direction.

Exceeding the Limit with Grid Images (Tiling)

If you need to encode an image larger than 65,536 x 65,536 pixels, libavif supports a feature called grid items (or image tiling).

The AVIF specification allows a single large image to be split into a grid of smaller, independently encoded AV1 image items. The decoder then reconstructs these pieces into a single canvas. By utilizing grids, the theoretical resolution limit becomes virtually unlimited, as you can tile multiple 65,536-pixel segments together.

Practical Encoding Constraints

While the format itself allows for massive resolutions, you may encounter practical limitations during the encoding process: