All formats

AVIF libraries

Open-source libraries that decode and encode AVIF files. Almost all of them wrap the same C code: libavif or libheif for the container, dav1d or libaom to decode AV1, and libaom, SVT-AV1 or rav1e to encode. Which codecs your build has decides what works: a library built with only dav1d can read AVIF but not write it.

Language Library Read Write Notes
C/C++ libavif yes yes reference library, every AVIF feature, animation
C/C++ libheif yes yes HEIF container library: AVIF, HEIC and more; LGPL
C/C++ heicdec yes no plain-C AVIF + HEIC decoder, AV1 through dav1d; AGPL
C# Magick.NET yes yes ImageMagick for .NET, 100+ formats
C# NetVips yes yes libvips binding, fast, low memory
Go gen2brain/avif yes yes libavif in WebAssembly, no cgo; animation
Python Pillow yes yes built in since Pillow 11.3 wheels; 8-bit only
Python pyvips yes yes libvips binding; 10/12-bit, large images
Ruby ruby-vips yes yes libvips binding
Rust ravif no yes pure Rust encoder (rav1e)
Rust image yes yes encodes with ravif; decoding needs dav1d
PHP GD yes yes bundled with PHP 8.1+ (if built with libavif)
PHP Imagick yes yes ImageMagick extension, via libheif

There is no maintained open-source AVIF library for Java: call libavif through JNI or Panama, run avifenc/avifdec as a process, or convert on a server with libvips.

By language#