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 |
|
0.6.3 | Oct 18, 2020 |
#3 in #avif
3,464 downloads per month
Used in 3 crates
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