Glossary
WebP
An image format from Google that stores photos and graphics, with lossy or lossless compression, transparency and animation, in smaller files than JPEG or PNG.
A WebP file is an image in the format Google released in 2010 to make web pages lighter. It supports lossy compression for photos, lossless compression for graphics, transparency and animation in a single format, and typically produces files noticeably smaller than an equivalent JPEG or PNG. Every major browser now displays WebP, so it has become one of the most common image formats on the web, and one that any system collecting images from websites will meet constantly.
How WebP works
WebP has two codecs under one file extension. Lossy WebP is based on the intra-frame coding of the VP8 video codec: the image is split into macroblocks, each block is predicted from its neighbours, and only the difference is transformed, quantised and entropy-coded. Because the method comes from video, lossy WebP shares some traits with a video codec, including 8-bit colour and 4:2:0 chroma subsampling, which halves colour resolution in each direction. Lossless WebP, added in 2012, uses a different algorithm built on predictive transforms, colour caching and LZ77-style back references, and keeps every pixel exactly.
Google’s published measurements put lossy WebP at roughly 25 to 34 percent smaller than JPEG at similar perceived quality, and lossless WebP at roughly a quarter smaller than PNG. Real savings depend on the image and the encoder settings. Simple graphics and screenshots often gain more; already heavily compressed photos gain less.
Both modes support an alpha channel, so a WebP can replace a transparent PNG while staying far smaller. Animated WebP stores a sequence of frames, each lossy or lossless, which makes it a lighter alternative to animated GIF. Lossy images with transparency compress the colour and the alpha channel separately, so soft edges and shadows survive at small file sizes.
What is inside a WebP file
A WebP file is a RIFF container, the same chunk-based structure used by WAV audio. The first four bytes are RIFF, followed by the file size and the four characters WEBP, which is the signature file type detection looks for. After the header come chunks: VP8 for a simple lossy image, VP8L for a lossless one, or VP8X for the extended format, which signals optional features such as alpha, animation, colour profiles and metadata.
The extended format can carry an ICC colour profile, an EXIF chunk and an XMP chunk. That means a WebP can hold the same camera and copyright information as a JPEG, using the fields described under EXIF data and XMP metadata, but in practice many conversion tools and image CDNs strip those chunks to save bytes. A WebP found on the web is far less likely to carry capture metadata than the original photo it was made from. The MIME type is image/webp, and WebP was formally specified by the IETF in RFC 9649 in 2024.
WebP compared with other image formats
WebP sits between the long-established formats and the newer ones built on modern video codecs.
Format | Compression | Transparency | Animation | Browser support | Typical role |
|---|---|---|---|---|---|
WebP | Lossy (VP8) or lossless | Yes | Yes | All major browsers | General web images |
JPEG | Lossy | No | No | Universal | Photos, camera output |
PNG | Lossless | Yes | No (APNG aside) | Universal | Graphics, screenshots |
GIF | Lossless, 256 colours | 1-bit | Yes | Universal | Legacy animation |
AVIF | Lossy or lossless (AV1) | Yes | Yes | All major browsers in recent versions | High-efficiency web images |
HEIC | Lossy (HEVC) | Yes | Sequences | Safari only | iPhone camera output |
The trade-offs are straightforward. WebP decodes quickly and is supported everywhere that matters for the web, which is why many sites and CDNs serve it by default. AVIF usually compresses further but encodes more slowly. HEIC compresses well but remains largely confined to Apple devices, and TIFF stays in archives and print workflows where fidelity matters more than size. WebP’s weaknesses are its 8-bit limit, which rules it out for HDR, and its chroma subsampling in lossy mode, which can blur fine coloured text and thin coloured lines.
Where WebP files appear
WebP is everywhere content is served to browsers. Product images on e-commerce sites, article images on news sites, user avatars and thumbnails are commonly WebP, often generated on the fly by an image CDN that converts the original upload when a browser says it accepts the format. Social cards are another source: the og:image declared in a page’s Open Graph tags is often a WebP, so any link preview service needs to handle it. Messaging apps and some Android screenshot and sticker tools save WebP as well, so user uploads include it too.
That makes WebP the default image type in web scraping and web archiving. A crawler collecting product catalogues, a research agent saving pages as bookmarks or a brand team pulling competitor creative will gather WebP files in bulk. Downloads can also be misleading: the same image URL may return WebP to a client that advertises support and JPEG to one that does not, so a pipeline should check the bytes and the Content-Type header, not the file extension in the URL.
Converting to and from WebP
Conversion into WebP usually happens at publish time. Google’s cwebp encoder, libvips, ImageMagick and most image CDNs produce WebP from JPEG or PNG, with a quality setting for lossy output and an effort setting for lossless. A quality of around 75 to 85 is a common starting point for photos. Converting a JPEG to lossy WebP compresses an image that has already lost information once, so results are best when the encoder starts from the original rather than from a JPEG copy.
Conversion out of WebP comes up when a downstream tool does not accept it. Older desktop software, some print services and some machine learning pipelines still expect JPEG or PNG. Converting lossless WebP to PNG is exact. Converting lossy WebP to JPEG adds a second round of loss, so it is better to keep the highest-quality source available and convert from that. Animated WebP has no direct equivalent in JPEG or PNG and is usually turned into a GIF, an MP4 or a set of still frames, depending on where it is going.
Processing WebP images for search and AI
Most modern image libraries read WebP, so decoding is rarely the hard part. The work is in turning pixels into something searchable. Image captioning produces a description that text queries can match. OCR reads text in the image, which is common in WebP graphics such as banners, infographics and screenshots. Colour extraction records the dominant palette, which design and e-commerce teams use to filter by colour. Image embeddings let a system find visually similar images from an example.
Deduplication matters more for WebP than for most formats, because the same picture often exists as a JPEG original, several WebP renditions at different sizes and a cropped social card. Perceptual hashing and near-duplicate detection group those variants so search results show one image rather than six copies. Keeping a pointer from each rendition to its original also helps when a user wants the full-resolution file rather than a thumbnail. Where metadata has been stripped, metadata extraction has less to work with, and visual signals carry more of the load.
OCR quality deserves a note. Lossy WebP at aggressive quality settings smears small text, especially coloured text on coloured backgrounds, because of the chroma subsampling described above. If an image will be read by OCR, keep a higher-quality version or a lossless rendition, and test accuracy on real samples rather than assuming the format is neutral. Combined with captions and visual similarity, these signals give multimodal search across a library, which the post on image search beyond tags discusses in more depth.
Animated WebP needs its own decision. Some systems index only the first frame, which misses most of what an animation shows; others sample frames at intervals and treat the file like a short clip. For banners and product spins, sampling a handful of frames is usually enough.
How Exabase handles WebP
WebP is one of the image formats Extract documents alongside JPEG, PNG and GIF, so it needs no conversion step before extraction. Submitting a WebP file or its URL to POST /v2/extract returns width, height, OCR text, a CDN-hosted thumbnail and any capture attributes the file carries, such as camera type and ISO. The image to JSON tool shows the output for a single image, and the extract endpoint reference covers the request.
Stored as Resources in a Base, images are processed as they arrive: thumbnails in several sizes, captions and keywords, dominant colours, OCR text, grouped attributes and a malware scan. Deep Search then searches them by text, by an example image, by colour or by similarity to another resource, ranked in one list with documents, audio and video. The asset search solution describes the pattern, and the brand asset search use case applies it to a marketing library.
For web pages, the Link Preview API returns a page’s preview image with its dimensions, file size and MIME type, which is often a WebP, without creating a job. Exabase is the infrastructure layer here; how images are ranked, filtered or shown to users remains the application’s choice. Teams comparing options can start with the best multimodal search APIs roundup.
Frequently asked questions
Is WebP better than JPEG?
For web delivery, usually yes. WebP files are typically 25 to 34 percent smaller than comparable JPEGs and also support transparency and animation. JPEG remains more universal outside browsers and is still the default for camera output.
Is WebP lossy or lossless?
Both. WebP has a lossy mode based on VP8 for photos and a separate lossless mode for graphics, and either can include an alpha channel.
What is the MIME type of WebP?
image/webp. The file itself starts with the bytes RIFF and contains WEBP at bytes 8 to 11, which is how tools identify it regardless of extension.
Do all browsers support WebP?
Yes, all current major browsers display WebP, including Safari since version 14. Very old browsers and some email clients do not.
Does WebP keep EXIF metadata?
It can. The extended WebP format has EXIF and XMP chunks, but many converters and image CDNs strip them, so web-sourced WebP files often carry little or no metadata.
Can OCR read text in WebP images?
Yes, the same as any raster image. Heavy lossy compression can blur small or coloured text, so OCR accuracy is best on high-quality or lossless WebP files.
Why do some downloads of the same image return WebP and others JPEG?
Content negotiation. Many CDNs check the browser’s Accept header and serve WebP only to clients that support it, so the format depends on who asks, not on the URL.
Related pages: HEIC, TIFF, EXIF data, MIME type, og:image, image captioning, colour extraction, near-duplicate detection, asset search, image to JSON