What is a WebP file and how is it better than other formats
January 1, 2025
WebP is a raster graphics file format developed by Google intended as a replacement for JPEG, PNG, and GIF file formats. It supports both lossy and lossless compression, as well as animation and alpha transparency.
What is a WebP file
A file with the .webp extension is a file format developed by Google to reduce the size of images without sacrificing quality for disk space. WebP images are designed to speed up the web while keeping quality, allowing high-quality photographs to be used on websites while reducing the amount of data transferred over the network.
The WebP format (pronounced Weppy) is a sister project to the WebM video container format, based on the VP8 video codec developed by On2 Technologies, released by Google. Google acquired On2 Technologies on February 19, 2010, and then released WebP in September of that year.
Since 60%-65% of the bytes on most web pages are images, Google decided to create a free, open-source file format that implements both lossy and lossless image formats in high quality. By maintaining quality but reducing the size of images, pages load faster, use less bandwidth, and save battery life, especially on mobile devices when web pages use WebP images. And all this happens without sacrificing photo quality.
WebP uses predictive compression to encode an image, which examines the values in adjacent blocks of pixels to predict the values in a block, then encodes only the differences between them. This allows pixels to be copied multiple times in a single file, and redundant data is removed from each block. By storing only the data that changes between each block, the amount of data stored is reduced compared to PNG and JPEG formats. You can learn more on the official WebP compression reference page.
WebP images that use lossless compression are 26% smaller than PNG files. And WebP images that use lossy compression are 34% smaller than JPEG files with an equivalent structural similarity index (SSIM).
The WebP container (i.e., RIFF container for WebP) allows feature support over and above the basic use case of WebP (i.e., a file containing a single image encoded as a VP8 key frame). The WebP container provides additional support for:
- Metadata. An image may have metadata stored in Exif or XMP formats.
- Transparency. An image may have transparency, i.e., an alpha channel.
- Color profile. An image may have an embedded ICC profile as described by the International Color Consortium.
Why WebP is better than JPG / JPEG
- WebP can store both lossy and lossless images, while JPG (JPEG) only supports lossy images.
- WebP supports transparency (alpha channel), while JPG (JPEG) does not support transparency.
- When using lossy compression, WebP files take up less space than JPG (JPEG).
Note: in the following examples, you can download all the files in full size by clicking on the corresponding image.
An example of a JPG file (size 4.7 megabytes):
The same file in WebP format with the same compression level (size 3.4 megabytes):
And another example of a JPG file (size 4.3 megabytes):
The same file in WebP format with the same compression level (size 3.0 megabytes):
Why WebP is better than PNG
What WebP and PNG have in common is that:
- both formats support transparency (alpha channel)
- both formats can support lossless image compression
The advantage of WebP is that even with lossless file compression, files take up less space than PNG.
Google has proposed using WebP for animated images as an alternative to the popular GIF format, citing the advantages of 24-bit color with transparency, combining frames with lossy and lossless compression in the same animation, and support for seeking to specific frames. Google reports a 64% reduction in file size for images converted from animated GIFs to lossy WebP, however, with a very noticeable visual impact, both at default settings, and optimised settings. When converting using lossless WebP, a 19% reduction is achieved as reported by Google, although real world performance is nearer to 10%.
An example of a PNG file (size 2.3 megabytes):
The same file in WebP format with lossless compression (size 1.7 megabytes):
An example of a PNG file (size 2.2 megabytes):
The same file in WebP format with lossless compression (size 1.6 megabytes):
How WebP is better than HEIC
In terms of technical capabilities, including the degree of compression, the HEIC format is superior to WebP.
But the advantage of WebP is its wider support. For example, WebP photos can be displayed by all modern web browsers, while HEIC is not supported by any web browser.
HEIC files require more computing resources to display. You may notice that HEIC photos take significantly longer to open on your computer than other formats, including WebP.
See also:
- How to enable saving photos in HEIC (HEIF) format in Android and whether it should be done
- Free online HEIC (HEIF) converter
Conclusion. Will WebP replace JPG photos?
Judging by current trends, some websites use WebP images. But no fewer sites still use JPG and PNG. It looks like WebP will take a certain place as a format used for images on websites, but it won’t completely replace other formats. At least not in the near future.
As for competition as a format for photos that users take with phones and cameras, WebP is usually not offered as an alternative to JPG. An alternative (and competitor) to JPG is the HEIC format, which surpasses WebP in technical characteristics, such as support for greater color depth, higher compression ratio with the same image quality.
Online services:
- Compress images without losing quality. Convert to WebP
- Convert WebP to JPG, PNG, HEIC, AVIF
- Check if WebP is lossless or lossy
Related articles:
- Easy way to create and convert WebP (lossless and lossy) in Windows (96.6%)
- Easy way to create and convert AVIF (lossless and lossy) in Windows (96.6%)
- How to open AVIF files on Windows (75.1%)
- How to enable saving photos in HEIC (HEIF) format in Android and whether it should be done (64.4%)
- Batch image processing in GIMP (60.8%)
- How to reboot a server in DigitalOcean (RANDOM - 3.4%)