Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

AVIF image creator in pure Rust

License

NotificationsYou must be signed in to change notification settings

avif-community/cavif-rs

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

47 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Encoder/converter for AVIF images. Based onrav1e andavif-serialize, which makes it a pure Rust tool, with no C code!

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.

Compatibility

  • Chrome 85 desktop and libavif: full support. Support for--premultiplied-alpha option is coming soon.
  • Chrome on Android 12: full support.
  • Firefox 86: not compatible with images with alpha channel yet.

Running

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

cavif image.png

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

cavif --quality 60 image.png

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 have different meaning than JPEG's quality scale.Beware when comparing codecs. There is no lossless compression support.
  • --speed=n — Encoding speed between 1 (best, but slowest) and 10 (fastest, but a blurry mess), the default value is 1. Encoding of AVIF is pretty slow, so you need either a) beefy multicore machine b) avoid large images c) patience.
  • --overwrite — Replace files if there's .avif already. By default existing files are left untouched.
  • -o path — Write output to this path instead of samefile.avif. If multiple input files are specified, it's interpreted as a directory.
  • --quiet — Don't print anything during conversion.
  • --premultiplied-alpha — May improve compression of transparent images by lowering quality of semi-transparent colors. Warning: new feature, may not be compatible with all decoders yet.
  • --dirty-alpha — Don't change RGB values of transparent pixels. By default irrelevant color of transparent pixels is cleared to avoid wasting space.
  • --color=rgb — encode using RGB color space instead of YCbCr color space. Makes color closer to lossless, but makes files larger.

Building

To build it from source you need:

  • Rust 1.48 or later, preferably viarustup
  • nasm 2.14 or later

Then run in a terminal:

cargo install cavif

Packages

No packages published

Languages

  • Rust100.0%

[8]ページ先頭

©2009-2025 Movatter.jp