#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 57303/week @ 2024-08-21 57678/week @ 2024-08-28 60331/week @ 2024-09-04 66393/week @ 2024-09-11 62527/week @ 2024-09-18 70376/week @ 2024-09-25 68260/week @ 2024-10-02 70097/week @ 2024-10-09 79214/week @ 2024-10-16 76101/week @ 2024-10-23 81284/week @ 2024-10-30 80691/week @ 2024-11-06 78079/week @ 2024-11-13 79568/week @ 2024-11-20 84284/week @ 2024-11-27 85871/week @ 2024-12-04

341,677 downloads per month
Used in 73 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