#avif #convert #av1 #rav1f #cav1f

ravif

rav1e-based pure Rust library for encoding images in AVIF format (powers the cavif tool)

11 unstable releases (4 breaking)

0.11.1 Jan 24, 2023
0.11.0 Dec 11, 2022
0.10.0 Dec 6, 2022
0.9.1 Nov 3, 2022
0.6.3 Oct 18, 2020

#3 in #avif

Download history 2222/week @ 2022-10-13 997/week @ 2022-10-20 1336/week @ 2022-10-27 771/week @ 2022-11-03 1143/week @ 2022-11-10 648/week @ 2022-11-17 543/week @ 2022-11-24 854/week @ 2022-12-01 904/week @ 2022-12-08 648/week @ 2022-12-15 511/week @ 2022-12-22 535/week @ 2022-12-29 925/week @ 2023-01-05 720/week @ 2023-01-12 1065/week @ 2023-01-19 663/week @ 2023-01-26

3,464 downloads per month
Used in 3 crates

BSD-3-Clause

35KB
617 lines

ravif — Pure Rust library for AVIF image encoding

Encoder for AVIF images. Based on rav1e and avif-serialize.

The API is just a single encode_rgba function call that spits an AVIF image.

This library powers cavif encoder. It has encoding configuration specifically tuned for still images, and gives better quality/performance than stock rav1e.


lib.rs:

use ravif::*;
# fn doit(pixels: &[RGBA8], width: usize, height: usize) -> Result<(), Error> {
let res = Encoder::new()
    .with_quality(70.)
    .with_speed(4)
    .encode_rgba(Img::new(pixels, width, height))?;
std::fs::write("hello.avif", res.avif_file);
# Ok(()) }

Dependencies

~13MB
~325K SLoC