AVIF libraries for Rust
- ravif encodes RGB/RGBA pixels to AVIF in pure Rust, with the rav1e AV1 encoder. No C dependencies, so it builds everywhere
cargodoes. It doesn’t decode. - image is the general image crate. Its default
aviffeature encodes with ravif; decoding needs theavif-nativefeature, which links the C dav1d library.
The image crate’s decoder is built from 2 crates you can also use directly: mp4parse (Mozilla’s container parser, used by Firefox) and dav1d (bindings to the dav1d decoder).
- image The Rust image crate encodes AVIF with ravif and decodes it with dav1d. How to enable the avif and avif-native features, convert PNG to AVIF, set speed.
- ravif ravif is a pure Rust AVIF encoder based on rav1e. How to add it, encode RGBA pixels to AVIF, convert PNG to AVIF, set quality, speed, alpha quality.