Expand description
Fast WebP encoding for the two common Rust workflows:
imagecrate buffers (DynamicImage,RgbImage,RgbaImage) to WebP.- JPEG/PNG bytes from servers and proxies to WebP bytes.
The low-level hot path is intentionally small:
RGB/RGBA bytes are validated and passed directly to libwebp-sys.
use fast_webp::{encode_rgb, WebpOptions};
let rgb = [255, 0, 0, 0, 255, 0, 0, 0, 255, 255, 255, 255];
let webp = encode_rgb(&rgb, 2, 2, WebpOptions::default())?;