Decoder options; see WebpDecoderOptions. Defaults to SDK-global wasm resolution.
Decode a WebP byte buffer to RGBA8 pixels. Initializes the vendored wasm on first use, then frees the wasm-side image after copying its pixels out.
The complete WebP file as a Uint8Array (the full RIFF
container, not a partial chunk).
A WebpImageData whose rgba is 8-bit RGBA, length
width * height * 4 bytes.
Browser WebP decoder over the vendored pure-Rust
turbowebpwasm (no emscripten). Decodes a WebP byte buffer to RGBA8 pixels plus dimensions.Remarks
Every still-image bitstream family decodes: lossy
VP8, losslessVP8L, and the extendedVP8Xcontainer carrying anALPHalpha chunk (asserted over libwebp-encoded fixtures inwebp-conformance.test.ts). Animated WebP (ANIM/ANMF) is not supported and rejects. The decoder is reusable: construct once and call WebpDecoder.decode per image. The underlying wasm is a process-wide singleton initialized on the first decode (seeensureWasm).Example
Example