All formats

WebP libraries

Open-source libraries that decode and encode WebP files. Almost all of them use Google’s libwebp underneath; pure implementations exist for C# (ImageSharp), Java (TwelveMonkeys, decode only), Go (x/image/webp, decode only) and Rust (image-webp, lossless encode only). Check animation support if you need it: many libraries read only the first frame.

Language Library Read Write Notes
C/C++ libwebp yes yes reference implementation, lossy, lossless, animation
C# ImageSharp yes yes pure managed code, animation
C# SkiaSharp yes yes Skia wrapper, bundles libwebp
C# Magick.NET yes yes ImageMagick for .NET, animation
Java webp-imageio yes yes ImageIO plugin, JNI to libwebp
Java TwelveMonkeys yes no pure Java ImageIO plugin
Go x/image/webp yes no pure Go, Go team’s extended library
Go gen2brain/webp yes yes libwebp without cgo, animation
Python Pillow yes yes lossy, lossless, animation, metadata
Python OpenCV yes yes images as NumPy arrays
Ruby ruby-vips yes yes fast, low memory, animation
Rust image-webp yes lossless pure Rust, used by the image crate
Rust webp yes yes safe bindings to libwebp, lossy encoding
Rust image yes lossless high-level, many formats
PHP GD yes yes bundled with PHP, no animation
PHP Imagick yes yes ImageMagick extension, animation

By language#