otf-pixels-codec-avif
AVIF for Pixels, container and AV1 written from scratch
An Open Tech Foundation project
Decodes AVIF stills at 8, 10 and 12 bits and encodes lossy 8-bit, owning both the HEIF container and the AV1 bitstream.
[!TIP] Building an app or a server? Use
otf-pixelsinstead: it picks this codec from the file's bytes with itsaviffeature.
Use it
Transcode row by row, without holding the image:
use ;
use ;
use EncodeOptions;
let mut decoder = new?;
let descriptor = decoder.descriptor;
let mut encoder = from_options;
let mut out = Vecnew;
encoder.write_header?;
let mut row = vec!;
for _ in 0..descriptor.height
encoder.finish?;
Capabilities
| Area | Support |
|---|---|
| Decode | Still images, 8/10/12-bit, alpha |
| Encode | Lossy, 8-bit |
| Not yet | Image sequences (avis) report Unsupported |
| Checked against | libaom and libavif |
API
| Item | What it does |
|---|---|
AvifDecoder, AvifInfo |
Decoder and the parsed file summary |
AvifEncoder |
Encoder; new, from_options |
AvifCodec, probe |
Signature detection |
Meta, Item, boxes |
The HEIF container, for direct use |
Part of Pixels
| Crate | Role |
|---|---|
otf-pixels |
The chainable Image API most users want |
otf-pixels-core |
Graph, tiles, scheduler, codec and op traits |
otf-pixels-ops |
Image operations |
otf-pixels-compress |
DEFLATE, zlib, LZW, checksums |
otf-pixels-codec-* |
One crate per format |
License
Apache-2.0 — see LICENSE.