libavif is a portable, open-source C library that implements encoding and decoding for the AVIF (AV1 Image File Format), offering a robust, production-ready way to work with AVIF images across platforms. It supports all AV1-supported YUV formats and bit-depths, including alpha (transparency), and includes command-line tools (avifenc and avifdec) to easily convert to/from AVIF from common image formats like JPEG, PNG, or Y4M. The API is straightforward, allowing applications to integrate AVIF support natively — creating, decoding, compressing, or decompressing images programmatically. Recent developments have added experimental support for HDR gain maps, improved color-space handling (including wide color gamut and high bit depth), and better quality tuning modes for encoding, making libavif a cutting-edge tool for high-quality image compression.
Features
- Encoding and decoding support for AVIF images, including all AV1-supported bit-depths, color formats, and alpha channel for transparency
- Command-line utilities (avifenc, avifdec) for converting between common formats (JPEG/PNG/Y4M) and AVIF for easy use in scripts or pipelines
- API for programmatic creation, decoding, and manipulation of AVIF images — usable in C/C++ applications or bindings
- Support (since recent versions) for HDR gain-map encoding — enabling high dynamic range (HDR) AVIF images while maintaining backward compatibility with SDR displays
- Efficient compression achieving much smaller file sizes than traditional formats while preserving visual fidelity — beneficial for web, storage, or bandwidth-sensitive applications
- Cross-platform portability and active maintenance, making it a reliable library for image handling in varied environments