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

ravif

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

16 releases

0.11.10 Aug 8, 2024
0.11.9 Jul 25, 2024
0.11.7 Jun 16, 2024
0.11.5 Mar 14, 2024
0.6.3 Oct 18, 2020

#451 in Images

Download history 42600/week @ 2024-06-14 42189/week @ 2024-06-21 43713/week @ 2024-06-28 46968/week @ 2024-07-05 45745/week @ 2024-07-12 49481/week @ 2024-07-19 53223/week @ 2024-07-26 53014/week @ 2024-08-02 63070/week @ 2024-08-09 56909/week @ 2024-08-16 57728/week @ 2024-08-23 58109/week @ 2024-08-30 62607/week @ 2024-09-06 63186/week @ 2024-09-13 68178/week @ 2024-09-20 57821/week @ 2024-09-27

261,417 downloads per month
Used in 26 crates (9 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
~328K SLoC