libavif implements the AV1 Image File Format in portable C. It encodes and decodes AV1 YUV formats and bit depths including alpha, and ships command-line tools avifenc and avifdec.
Overview
libavif provides a C implementation of the AV1 Image File Format for reading and writing .avif files. It handles the AV1-supported YUV layouts and bit depths, including alpha channels, and packages encoder and decoder utilities alongside the library API.
Applications link against the library or call the avifenc and avifdec tools for batch work. Example programs illustrate API usage when built with the examples CMake option. Tagged releases are recommended over tracking the main branch alone.
The project integrates optional AV1 codecs, libyuv for color conversion, and other dependencies controlled through CMake flags for system-installed or locally built libraries. Packages are available on major operating systems, with platform-specific install paths documented for Windows binaries, macOS Homebrew or MacPorts, and common Linux families.
Developers can enable tests, fuzzing, and coverage targets through CMake options. The core library is written in C99, with most tests in C++14.
Key features
- AVIF encode and decode
- All AV1 YUV formats and depths
- Alpha channel support
- avifenc and avifdec CLI tools
- Optional AV1 codec backends
- Libyuv color conversion
- CMake build and packaging
- Example API programs
Use cases
- Adding AVIF support to apps
- Batch image conversion
- Web and media pipelines
- Cross-platform image tooling
- Evaluating AV1 still images