zenrav1e 0.1.2

AV1 encoder optimized for still and animated AVIF images (Imazen fork of rav1e)
Documentation

zenrav1e CI crates.io lib.rs docs.rs license

AV1 encoder optimized for still and animated AVIF images. Fork of rav1e by Imazen.

Fork of rav1e

All changes are additive on top of upstream rav1e.

Encoding features

  • Quantization matrices — frequency-dependent quantization weights, ~10% BD-rate improvement
  • Filter intra prediction — 5 recursive filter modes, auto-enabled at speed <= 6
  • Trellis quantization (experimental, disabled by default — marginal gains at +34% encode time)
  • Variance adaptive quantization (VAQ) (experimental, disabled by default)
  • Tune::StillImage mode — tuning preset for photographic content
  • Lossless mode — mathematically lossless encoding via quantizer: 0
  • Cooperative cancellationenough::Stop support behind the stop feature

Modernization

  • Rust 2024 edition (MSRV 1.89)
  • safe_unaligned_simd for safe SIMD load/store in entropy coding

All upstream rav1e video encoding capabilities are preserved.

Usage

zenrav1e is a library. If you want to encode AVIF images, use ravif or zenavif, which wrap zenrav1e with a higher-level API.

For direct use:

use zenrav1e::prelude::*;

let mut enc = EncoderConfig::default();
enc.width = 640;
enc.height = 480;
enc.speed_settings = SpeedSettings::from_preset(6);
enc.still_picture = true;
enc.enable_qm = true;  // quantization matrices

let cfg = Config::new().with_encoder_config(enc);
let mut ctx: Context<u8> = cfg.new_context().unwrap();
// send frames, receive packets...

Building

# Pure Rust (no asm) — primary development target
cargo check --no-default-features --features threading
cargo test --no-default-features --features threading

# With x86_64 asm (requires nasm)
cargo check --features threading

Requires Rust 1.89+. The asm feature needs NASM 2.14.02+ on x86_64.

Image tech I maintain

State of the art codecs* zenjpeg · zenpng · zenwebp · zengif · zenavif (rav1d-safe · zenrav1e · zenavif-parse · zenavif-serialize) · zenjxl (jxl-encoder · zenjxl-decoder) · zentiff · zenbitmaps · heic · zenraw · zenpdf · ultrahdr · mozjpeg-rs · webpx
Compression zenflate · zenzop
Processing zenresize · zenfilters · zenquant · zenblend
Metrics zensim · fast-ssim2 · butteraugli · resamplescope-rs · codec-eval · codec-corpus
Pixel types & color zenpixels · zenpixels-convert · linear-srgb · garb
Pipeline zenpipe · zencodec · zencodecs · zenlayout · zennode
ImageResizer ImageResizer (C#) — 24M+ NuGet downloads across all packages
Imageflow Image optimization engine (Rust) — .NET · node · go — 9M+ NuGet downloads across all packages
Imageflow Server The fast, safe image server (Rust+C#) — 552K+ NuGet downloads, deployed by Fortune 500s and major brands

* as of 2026

General Rust awesomeness

archmage · magetypes · enough · whereat · zenbench · cargo-copter

And other projects · GitHub @imazen · GitHub @lilith · lib.rs/~lilith · NuGet (over 30 million downloads / 87 packages)

License

Dual-licensed: AGPL-3.0 or commercial.

I've maintained and developed open-source image server software — and the 40+ library ecosystem it depends on — full-time since 2011. Fifteen years of continual maintenance, backwards compatibility, support, and the (very rare) security patch. That kind of stability requires sustainable funding, and dual-licensing is how we make it work without venture capital or rug-pulls. Support sustainable and secure software; swap patch tuesday for patch leap-year.

Our open-source products

Your options:

  • Startup license — $1 if your company has under $1M revenue and fewer than 5 employees. Get a key →
  • Commercial subscription — Governed by the Imazen Site-wide Subscription License v1.1 or later. Apache 2.0-like terms, no source-sharing requirement. Sliding scale by company size. Pricing & 60-day free trial →
  • AGPL v3 — Free and open. Share your source if you distribute.

See LICENSE-COMMERCIAL for details.

Upstream code from xiph/rav1e is licensed under BSD-2-Clause. Our additions and improvements are dual-licensed (AGPL-3.0 or commercial) as above.

Upstream Contribution

We are willing to release our improvements under the original BSD-2-Clause license if upstream takes over maintenance of those improvements. We'd rather contribute back than maintain a parallel codebase. Open an issue or reach out.