Same WebP. No more libwebp.
A memory-safe libwebp drop-in. turbowebp-safe is zero-unsafe. turbowebp-libwebp-shim swaps in at the C ABI via LD_PRELOAD. 4.5x faster encode at 256-tile across both ISAs, byte-identical output across NEON / AVX2 / WASM SIMD128, and the entire CVE-2023-4863 risk class retires the moment the library is gone.
Drop-in for libwebp 1.6.0 (Google C reference). SIMD backends: AVX2, NEON, WASM SIMD128, scalar.
Headline
Memory-safe libwebp drop-in - 4.5x faster encode, 47/64 decode cells faster, byte-identical across ISAs.
Mac NEON and Win AVX2 at 256-tile (lossless)
pooled across NEON + AVX2 vs libwebp 1.6.0
Memory-safe implementation. Removes the CVE-2023-4863 risk class, not just the known patched bugs.
Prove It
Race it yourself. Right here.
TurboWebP against libwebp — Google's own C decoder, compiled to wasm — decoding the same lossless bytes in your browser. Both sandboxed wasm, apples-to-apples.
Encode performance
Faster at every tile size. On both architectures.
Lossless encode at quality=100 vs libwebp's highest-effort lossless setting (method=6). 400-sample real-world geospatial / EO corpus, n=100 per tile size, both encoders run at maximum effort. Output passes a 100/100 libwebp round-trip pixel-equality gate.
Encode speedup vs libwebp m=6
Hosts: Apple Silicon (NEON) and Intel (AVX2). Output bytes are byte-identical across the two architectures on every sample — verified by a per-sample byte diff (0 differences across 800 samples = 400 apex + 400 defaults).
Per data type
Wins across every workload we tested.
WebP encoding profiles look very different across imagery types. TurboWebP wins on all four, and is particularly dominant on the kinds of single-band imagery (SAR coherence quicklooks, AI inference masks) that the libwebp fast paths weren't tuned for.
Encode speedup by image type
Mac NEON, 256² tiles, lossless q=100 vs libwebp m=6. Size shows output bytes vs libwebp; smaller is better. At 512² and 2048², SAR quicklooks actually produce fewer bytes than libwebp's apex (0.993× and 0.996×). Win AVX2 ratios match within ~10% per cell; cross-arch output is byte-identical.
Decode performance
Decode the same files. Get there ~20% faster.
The libwebp lossy decode path has been frozen at SSE2/SSE4.1 since ~2012; AVX2 only landed for the lossless path in libwebp 1.6.0. TurboWebP's decoder is AVX2/NEON/SIMD128 end-to-end. Decoded RGBA bytes are byte-identical to libwebp on every input.
Decode speedup vs libwebp 1.6.0 — Win AVX2
Win AVX2 pooled decode_ratio (turbowebp / libwebp; lower is faster) across the 400-sample corpus, producer = libwebp m=6. 27 of 32 cells overall are faster than libwebp 1.6.0; the remaining 5 sit at 256² where fixed per-image setup costs dominate the small workload.
Why switch
A library swap. Not a migration.
- - Memory-safe trust boundary: turbowebp-safe has zero unsafe. CVE-2023-4863-class memory bugs are structurally impossible.
- - 4.5x faster encode at 256-tile across both ISAs (4.5x Mac NEON, 4.5x Win AVX2). Even at 2048-tile the gap holds at 1.27-1.49x.
- - 27 of 32 decode cells faster on Win AVX2 (20% pooled faster at 2048). 20 of 32 on Mac NEON. 47 of 64 cross-host.
- - Byte-identical encoder output across NEON / AVX2 / WASM SIMD128 - libwebp does not offer this.
- - turbowebp-libwebp-shim provides a C ABI replacement path: LD_PRELOAD / DYLD_INSERT_LIBRARIES / DLL drop with no host code changes.
Compatibility
Bit-exact on the wire.
- - VP8L lossless: bit-exact decode of all libwebp-emitted blobs (800/800 corpus parity).
- - VP8 lossy: bit-exact decode; encoder output within 3-4% of libwebp m=6 apex size at 4.5x speed.
- - Two cells BEAT libwebp m=6 on size: sar_csi 512 (0.993x) and sar_csi 2048 (0.996x).
- - WebP RIFF container unchanged - any libwebp consumer accepts TurboWebP output without modification.
- - ISAs: AVX2 (x86_64), NEON (ARM64), WASM SIMD128 (browser), scalar fallback.
libwebp.
Just faster, safer.
Existing pipelines, existing data, existing tooling. Swap the implementation, keep everything else.
WebP and libwebp are products of Google LLC. References here identify the products and formats being compared; no affiliation, sponsorship, or endorsement is implied. libwebp is published by Google under a BSD-3-Clause license. The WebP container format is openly specified and freely usable. TurboWebP is an independent, clean-room implementation of the WebP format compatible with the libwebp ABI. The live demo runs Google's unmodified libwebp decoder under its BSD-3-Clause license. Performance comparisons reflect our own measurements under the stated methodology; results vary by workload and hardware.