webpkit
A pure-Rust WebP codec — lossless (VP8L) and lossy (VP8), decode and encode, behind one API. This is the recommended entry point.
Part of the webpkit workspace.
One-call helpers cover the common case — raw RGBA8 in, WebP bytes out (and back):
use ;
For metadata preservation, effort tiers, non-RGBA layouts, or streaming, reach for
the decode function and the type-state Encoder builder:
use ;
See examples/roundtrip.rs for a complete, runnable
encode → decode round-trip.
decode is safe on untrusted input by default: it caps the canvas at
DEFAULT_MAX_PIXELS before allocating, so a hostile header cannot exhaust memory.
Use decode_with + DecodeOptions::max_pixels for a different cap, or
DecodeOptions::unbounded to lift it for trusted input.
Optional features
Off by default, so a plain dependency stays zero-dependency:
rayon— encoder data-parallelism (byte-identical output, only faster).image—TryFromconversions betweenimage::DynamicImage/RgbaImageand the codec'sImage.
License
Dual-licensed under MIT OR Apache-2.0.