#image-encoding #avif #av1 #convert #encoding #rav1f #cav1f

ravif

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

17 releases

0.11.11 Oct 17, 2024
0.11.9 Jul 25, 2024
0.11.5 Mar 14, 2024
0.11.3 Sep 21, 2023
0.6.3 Oct 18, 2020

#551 in Images

Download history 57957/week @ 2024-08-31 63545/week @ 2024-09-07 63135/week @ 2024-09-14 70156/week @ 2024-09-21 67166/week @ 2024-09-28 68928/week @ 2024-10-05 74001/week @ 2024-10-12 77063/week @ 2024-10-19 79165/week @ 2024-10-26 82878/week @ 2024-11-02 79038/week @ 2024-11-09 77803/week @ 2024-11-16 81193/week @ 2024-11-23 85181/week @ 2024-11-30 88647/week @ 2024-12-07 73410/week @ 2024-12-14

340,133 downloads per month
Used in 74 crates (11 directly)

BSD-3-Clause

38KB
670 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::*;
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);

Dependencies

~13MB
~327K SLoC