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

ravif

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

11 releases

0.11.5 Mar 14, 2024
0.11.3 Sep 21, 2023
0.11.2 May 9, 2023
0.11.1 Jan 24, 2023
0.6.3 Oct 18, 2020

#526 in Images

Download history 627/week @ 2023-12-23 1822/week @ 2023-12-30 2773/week @ 2024-01-06 1919/week @ 2024-01-13 3118/week @ 2024-01-20 1587/week @ 2024-01-27 1558/week @ 2024-02-03 2511/week @ 2024-02-10 2554/week @ 2024-02-17 2617/week @ 2024-02-24 2362/week @ 2024-03-02 10046/week @ 2024-03-09 25800/week @ 2024-03-16 39308/week @ 2024-03-23 35010/week @ 2024-03-30 29253/week @ 2024-04-06

131,647 downloads per month
Used in 13 crates (7 directly)

BSD-3-Clause

37KB
659 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

~14MB
~345K SLoC