Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
C

cavif-rs

> 编程语言
Open source

AVIF image creator in pure Rust

678 stars0 likes0 views
WebsiteGitHub

About

AVIF image creator in pure Rust

cavif — PNG/JPEG to AVIF converter

Encoder/converter for AVIF images. Based on rav1e and avif-serialize via the ravif crate, which makes it a pure-Rust tool.

Installation

➡️ Download the latest release ⬅️

The pre-built zip includes a portable static executable, with no dependencies, that runs on any Linux distro. It also includes executables for macOS and Windows.

Usage

Run in a terminal (hint: you don't need to type the path, terminals accept file drag'n'drop)

bash
cavif image.png

It makes image.avif. You can adjust quality (it's in 1-100 scale):

bash
cavif --quality 60 image.png

Advanced usage

You can also specify multiple images. Encoding is multi-threaded, so the more, the better!

cavif [OPTIONS] IMAGES...
  • --quality=n — Quality from 1 (worst) to 100 (best), the default value is 80. The numbers are only a rough approximation of JPEG's quality scale. Beware when comparing codecs. There is no lossless compression support, 100 just gives unreasonably bloated files.
  • --speed=n — Encoding speed between 1 (best, but slowest) and 10 (fastest, but a blurry mess), the default value is 4. Speeds 1 and 2 are unbelievably slow, but make files ~3-5% smaller. Speeds 7 and above degrade compression significantly, and are not recommended.
  • --overwrite — Replace files if there's .avif already. By default the existing files are left untouched.
  • -o path — Write images to this path (instead of same-name.avif). If multiple input files are specified, it's interpreted as a directory.
  • --quiet — Don't print anything during conversion.

There are additional options that tweak AVIF color space. The defaults in cavif are chosen to be the best, so use these options only when you know it's necessary:

  • --dirty-alpha — Preserve RGB values of fully transparent pixels (not recommended). By default irrelevant color of transparent pixels is cleared to avoid wasting space.
  • --color=rgb — Encode using RGB instead of YCbCr color space. Makes colors closer to lossless, but makes files larger. Use only if you need to avoid even smallest color shifts.
  • --depth=8 — Encode using 8-bit color depth instead of 10-bit. This results in a slightly worse quality/compression ratio, but is more compatible.

Compatibility

Images work in all modern browsers.

Building

To build it from source you need Rust 1.90 or later, preferably via rustup.

Then run in a terminal:

bash
rustup update
cargo install cavif

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

Rustavifavif-encoderimage-converterrust

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言