WEBP - WebP Image
WebP is Google's web image format with both lossy and lossless modes, transparency and animation, meant to replace JPG, PNG and animated GIF with smaller files.
WebP is an image format published by Google to make web pages lighter. Its lossy mode was built from the still-image techniques inside VP8, a video compression format, on the reasoning that a photograph is essentially a single video frame; a lossless mode, transparency and animation followed soon after the first release. The point of WebP is coverage: one format intended to do the work of JPG, PNG and animated GIF, and to do each of those jobs in fewer bytes. Every current major browser displays it, which is why pictures saved from a modern website so often arrive as a .webp file.
How a WebP stores its picture
A WebP is a container assembled from labelled chunks, and what is inside decides how the file behaves, because there are two completely different compression engines:
- Lossy WebP works like a video key frame. It predicts each block of pixels from its neighbours, keeps only the difference, turns that difference into frequency values and rounds them off. Information is thrown away, so a lossy WebP cannot be restored to the original pixels, and saving it again and again compounds the damage, exactly as with JPG.
- Lossless WebP is a different method altogether. It looks for repeated patterns and repeated colours across the whole image, keeps a small cache of colours it has recently used, and codes the result compactly. Nothing is discarded, so it competes with PNG rather than with JPG.
Either mode can carry a full alpha channel, so partial transparency works, and the transparency can be stored losslessly while the colours are lossy, a combination neither JPG nor PNG offers. Animation is a sequence of frames inside the same container, each with its own timing and with full colour, which removes GIF's 256-colour limit. One hard limit is worth knowing: a WebP cannot be larger than 16383 pixels in either direction, so very large scans and long panoramas simply do not fit.
What metadata a WebP carries
WebP does not invent a metadata scheme of its own. Metadata is the descriptive information stored beside the pixels, and the WebP container holds it in optional chunks that carry the existing standards. A report shows whichever ones are present:
- An EXIF chunk, holding the same camera block you would find in a JPG:
Make,Model,DateTimeOriginal,ExposureTime,FNumber,ISOSpeedRatings,FocalLength,LensModelandOrientation, plus the GPS group with latitude, longitude and altitude. - An XMP chunk, holding Adobe's XML metadata: creator, title, description, keywords, ratings, rights statements and edit history.
- An ICC profile chunk describing the colour space the numbers belong to.
There is no slot for IPTC, the older publishing standard, so IPTC fields survive a conversion into WebP only if the converter rewrites them as XMP.
The practical point is that a WebP is often completely bare. Command-line and server-side encoders drop metadata unless they are explicitly told to keep it, and images processed automatically by a website usually come out with nothing attached at all. That is not a guarantee, though. A WebP made from a phone photo by a converter that preserves metadata carries the original camera model, capture time and GPS coordinates across intact. If a file matters, read the report rather than assuming the conversion cleaned it.
When to use WebP
Use WebP for images on a website, which is exactly what it was designed for: fewer bytes for the same picture, with transparency, photographs and short animations all handled by one format. Lossy WebP stands in for JPG, lossless WebP for PNG on flat graphics, and animated WebP for animated GIF with far better colour.
Away from the browser it is a weaker choice. Desktop applications, print workflows, office software and older devices may not open it, so a WebP is an awkward thing to email or send to a printer, and JPG and PNG remain the safe currency there. Converting an existing JPG to lossy WebP also re-encodes a picture that has already lost detail once, so the second pass costs quality on top of the first. Convert from the best original you have, not from a file that was already delivered to you.