Have you ever been browsing the web and after seeing an image you would like to save and use elsewhere, you right click it and select the save facility only to find that it wants to save as a .webp file? What is a .webp file and why is it used on the web? How can you convert it to a normal image file you can view?
Web pages that feature images, and there are few that don’t these days, can be slow to display. If the images are large or if there are a lot of them, they add to the web page’s total size and the larger the size, the longer they take to download and display in the browser.
Large web pages also add to the load on the web server and when there are lots of visitors requesting web pages, the server will slow down and the site appears to be sluggish and unresponsive. If images could be made smaller, they would download more quickly and the web server would have less work to do. The website would appear to be more responsive and web pages would display faster for visitors.
In addition to this, there is the benefit of reduced bandwidth for mobile users. Lightweight web pages use less mobile phone data.
The WebP file format
Google invented the WebP file format as a way to reduce the size of images used on the web. A .webp image file is smaller than the .jpg and .png files that are normally used on websites.
JPEG images use what it called a lossy compression technique to make image files smaller. Image information is discarded, but with only a little compression it is very difficult to tell and the result looks like the original image. WebP can store images using a lossy compression technique too. However, for the same image quality WebP files are 25% – 34% smaller.
PNG images (often used instead of GIF these days), use compression to reduce the file size too, but they are an example of a lossless file format. No information is discarded during compression and the resulting image is identical to the original. Every pixel is preserved. WebP can be used to store images in lossless format too, but the resulting file is 26% smaller than for PNG files.
Get more information on WebP files here.
Who uses WebP files?
WebP would appear to be an excellent way to speed up web page display and website performance. It hasn’t exactly taken off yet though, but it might. It is supported by Google Chrome because WebP is Google’s invention. Opera supports it too, but modern versions of Opera are based on Chrome. It is used on Google websites, such as the Google Play store and it is supported on Android devices.
It is used on YouTube too. A quick look round revealed lots of JPEG and PNG images still, so it looks like it is used only on new content. Find a page with newly uploaded videos, right click animage and save. You’ll see that new pages use .webp images.
Apparently Facebook has been experimenting with WebP and some users report that their own images that they uploaded cannot be downloaded because they want to save as WebP files. It is not universally used across Facebook though.
The lack of support from Microsoft is holding back the adoption of WebP and Internet Explorer does not know how to handle WebP images. Open the same YouTube web page in Chrome and Internet Explorer and Chrome uses WebP and IE uses JPEG for the same images.
In order for a website to use WebP it must store images twice, once in each format. Code within the web page must then identify which browser is being used and download the appropriate image format. That is too much work for most website developers. It is easier to stick with a single file format that displays in every browser.
If Internet Explorer is ever updated to include support for WebP then it will quickly become the standard because the benefits are clear.
Convert to/from .webp
Google provides a collection of tools for people that want to convert images to the WebP file format or convert them from it to a standard file format.
The filenames are fairly explanatory and libwebp-0.4.0-windows-x86.zip is for Windows users and libwebp-0.4.0-mac-10.8.tar.gz is for Apple Mac users.
Unzip the archive and the Readme.txt file provides information on the utilities. For example, in the bin folder is cwebp.exe for converting images to WebP and dwebp.exe for converting WebP images to standard image formats.
To convert an image to WebP you would need to open a command prompt window (press Windows+R and enter cmd), navigate to the folder containing the cwebp.exe tool and images (create a folder C:\Images), then enter:
cwebp input.png -q 80 -o output.webp
input.png is the source image, -q 80 is a quality of 80 (like JPEGs there’s a quality/compression trade-off), -o means output and output.webp is the destination file. You can use –lossless to force lossless compression.
To convert a WebP image to a normal one, use a command like this:
dwebp input.webp –bmp –o output.bmp
This converts the input.webp image to bmp and outputs it as output.bmp.
Command line tools aren’t much fun and if you want a simple tool for converting WebP images to normal ones, use XnView. This is a freeware image browser and it can load WebP images and then save them in whatever format you want, such as JPEG.
Use the Browser tab to browse the disk drive, then double click the image to open it. Click the Save icon in the toolbar and select the file format you want in the Save as type list.