Format guide

How WebP works

WebP is a picture format Google introduced so the web could ship fewer bytes without inventing a new tag. Understanding the container and the two codecs inside it makes “webp to png” and “webp to jpg” less mysterious.

It is a RIFF file with a picture inside

On disk, a .webp file starts like a little WAV: the lettersRIFF, a size, then WEBP. Chunks follow. The important ones are VP8 (lossy still), VP8L(lossless still), and VP8X (extended: alpha, animation, ICC, EXIF, XMP). You do not need a hex editor to convert one — the browser already knows this map — but it explains why a “WebP” can be three different things in practice.

Lossy WebP (VP8)

Lossy WebP is a still-image use of the VP8 video codec. It predicts blocks from their neighbors, transforms residual error, and throws away coefficients the eye is less likely to miss. That is the same family of ideas as JPEG, with newer prediction and a bitstream aimed at the web.

Typical photos shrink past JPEG at a similar visual quality. The catch: once those coefficients are gone, no converter can put the film grain back. WebpUndo’s PNG export of a lossy WebP is a lossless copy of a lossy decode.

Advertisement slot — paste AdSense here

Lossless WebP (VP8L)

Lossless WebP uses spatial prediction, a color cache, and Huffman coding. It is aimed at the same jobs as PNG: UI, icons, graphics with flat color. It often beats PNG on file size while remaining reversible. If your source is lossless WebP, a PNG export should match the pixels the decoder produced, not a second artistic interpretation.

Alpha and animation

Extended WebP can carry an alpha plane next to a lossy or lossless picture. That is why product cutouts saved from a shop CMS arrive as WebP with a clean edge. Animation is a sequence of frames with offsets and disposal, closer to a tiny video than to GIF. WebpUndo is a still converter: it exports the frame the browser gives createImageBitmap, not a GIF or APNG.

Why sites serve WebP

Bandwidth is money and battery. A CDN that can send one WebP instead of a fat PNG to Chrome-class browsers saves both. HTML and <picture>let them keep a JPEG fallback for older clients. You, the person who right-clicked “Save image,” get whichever candidate the browser picked — often WebP — even if your next app does not speak it.

What the browser does when you convert

  1. Read the file from disk into memory (no network).
  2. Decode VP8 / VP8L into an ImageBitmap.
  3. Draw those pixels on a canvas.
  4. Encode PNG or JPEG with canvas.toBlob.
  5. Hand you a download link built from an object URL.

That pipeline is the whole product. There is no cloud renderer. For workplace review, see the privacy / no-upload guide.

Related reading