Library:Libwebp
| Developer | Google (WebM Project) |
|---|---|
| Platforms | any (portable C with SIMD); libwebp.dll, libwebp-7.dll (MinGW), libwebp.so.7, or static |
| Versions | 1.6.0 (June 2025) is the newest release read here |
| License | BSD-3-Clause |
| Website | https://developers.google.com/speed/webp |
| On this wiki | Facts · Code · Notes · Topics |
Google's reference WebP codec (C, BSD-3-Clause): libwebp (decoder and encoder), libwebpdemux, libwebpmux and libsharpyuv, shipped as libwebp.dll / libwebp.so.7 or statically in browsers, image toolkits, engines and Android. WebPGetDecoderVersion() returns the version as 0xMMmmrr, which identifies a build.
Overview
libwebp decodes and encodes Format:WebP (lossy VP8, lossless VP8L, alpha, animation through the demux/mux libraries). Unverified: browsers, Android, SDL_image, Pillow, libvips and game engines embed it.
Identification
- Version function:
WebPGetDecoderVersion()returns(DEC_MAJ_VERSION << 16) | (DEC_MIN_VERSION << 8) | DEC_REV_VERSION(src/dec/vp8_dec.c); in 1.6.0 that is 0x010600.WebPGetEncoderVersion()does the same withENC_*_VERSION(src/enc/webp_enc.c). A static build has the three constants as immediates inside these tiny functions (for exampleB8 00 06 01 00=mov eax, 0x10600). Unlike libpng or FFmpeg there is no version string literal in the library. - ABI version constants: every public call from the header passes
WEBP_DECODER_ABI_VERSION(0x0210 in 1.6.0),WEBP_ENCODER_ABI_VERSION(0x0210) orWEBP_DEMUX_ABI_VERSION(0x0107) as a last argument to the...Internalfunctions (WebPGetFeaturesInternal,WebPInitDecBufferInternal,WebPPictureInitInternal,WebPDemuxInternal). The immediates 0x0210 / 0x0107 next to calls reveal the API generation of the program that was compiled, not of the library. - Exports:
WebPGetDecoderVersion,WebPGetEncoderVersion,WebPGetInfo,WebPGetFeaturesInternal,WebPDecode,WebPEncodeRGB,WebPFree,WebPDemuxInternal; the DLL/so soname is libwebp.so.7:src/Makefile.amline 39 haslibwebp_la_LDFLAGS = -no-undefined -version-info 9:0:2(current 9, age 2, so major 9-2 = 7) andCMakeLists.txtreads that same line to build its SOVERSION (commit 0464ce36981fc8169f69923eb6957dd46848967a, 1.6.0);libwebpdecoderhas5:0:2, major 3. Major 7 at this commit only; other 1.x releases were not read. - Error strings (few; most errors are status codes):
Bad code word,bad partition length,Truncated header.,Not a key frame.,Incorrect keyframe parameters.,Frame setup failed,Frame not displayable.,cannot parse partitions,Alpha decoder initialization failed.,Output aborted.(fromsrc/dec,src/demux). - Bitstream constants: the lossy key-frame start code
9D 01 2Aand the lossless signature byte0x2Fcompared in the decoder; the RIFF testRIFF....WEBP.
Pitfalls
- libwebp is vendored statically by many projects; the version constants are tiny functions, so search for the
WebPGetDecoderVersionexport or theVP8/VP8L/VP8X/ANMFFourCC compares first. - Chrome, Android and Firefox carry libwebp under their own names; no file-name identification.
Code & repositories
Source: https://github.com/webmproject/libwebp (README, NEWS, doc/). Version history in NEWS (1.6.0 dated 6/30/2025, binary-compatible release).
- https://github.com/webmproject/libwebp @
0464ce36981fc8169f69923eb6957dd46848967a· license: BSD-3-Clause
libwebp source and specs: container spec, lossless bitstream spec, version constants in src/dec/vp8i_dec.h
Tested on: source read, not run: read the source · checked 2026-10-18; last activity 2026-10-16
Evidence & references
Read in the repository at commit 0464ce36981fc8169f69923eb6957dd46848967a: src/dec/vp8i_dec.h, src/dec/vp8_dec.c, src/enc/vp8i_enc.h, src/enc/webp_enc.c, src/webp/decode.h, src/webp/encode.h, src/webp/demux.h, NEWS.