Skip to main content

gamut_webp/
lib.rs

1//! WebP image encoder and decoder — an intra-frame VP8/VP8L still-image bitstream wrapped in a
2//! RIFF container.
3//!
4//! The public surface mirrors [`gamut-avif`](https://docs.rs/gamut-avif): a [`WebpEncoder`]
5//! implementing [`gamut_core::EncodeImage`] and a [`WebpDecoder`] implementing
6//! [`gamut_core::DecodeImage`].
7//! The container layer is [`gamut_riff`]; the codec layer is the [`vp8l`] (lossless, RFC 9649 §3)
8//! and [`vp8`] (lossy intra, RFC 6386) module trees, whose modules each cite the spec section they
9//! implement. The implementation status and milestones are tracked in `STATUS.md`.
10//!
11//! gamut is image-first, so only the intra/key-frame still-image subset of VP8 is in scope (no
12//! inter-frame prediction, motion, or sequences). Both codecs are fully implemented, for
13//! [`Rgb8`](gamut_core::Rgb8) and [`Rgba8`](gamut_core::Rgba8) input: **VP8L lossless**
14//! (every transform, LZ77, the color cache, meta prefix codes) and **VP8 lossy** key-frame intra
15//! (DC/V/H/TM and per-4×4 B_PRED prediction, the simple and normal loop filters, segmentation, 1/2/4/8
16//! token partitions, and skip). Transparent lossy images use the extended (`VP8X`) container with an
17//! `ALPH` alpha chunk. Every component is validated against libwebp as an oracle in both directions
18//! (bit-exact at the YUV-plane level for lossy), plus a malformed-input robustness corpus.
19#![forbid(unsafe_code)]
20
21mod config;
22mod decoder;
23mod encoder;
24
25pub mod alpha;
26pub mod vp8;
27pub mod vp8l;
28
29pub use config::{WebpConfig, WebpMode};
30pub use decoder::WebpDecoder;
31pub use encoder::WebpEncoder;
32pub use gamut_core::Dimensions;