Skip to main content

Crate fast_webp

Crate fast_webp 

Source
Expand description

Fast WebP encoding for the two common Rust workflows:

  • image crate 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())?;

Structs§

WebpOptions

Enums§

InputFormat
WebpError

Functions§

convert_bytes_to_webp
detect_format
encode_dynamic_image
encode_rgb
encode_rgb_image
encode_rgba
encode_rgba_image