Preliminary observations regarding the WebP image file format

Less than a month ago, Google announced an early version of a new lossy file format called WebP. If that name sounds familiar to you, you are right, it shares the technology of the WebM video file format. The central claim of WebP is

WebP offers compression that has shown 39.8% more byte-size efficiency than JPEG for the same quality in a large scale study of 900,000 images on the Web.

Some description about the study can be found at Google.com. There is also a gallery with a couple of images taken from the media repository Wikimedia Commons. Since Google has released the tool to create .webp images, I was able to conduct some tests on my own.

Elke Twesten, member of the state parliament of Lower Saxony, Germany

I did not want to pollute my test with an image that had already been compressed in a lossy format before. Since my camera can output both JPEG and CR2 (canon raw) files, I could use one of the RAW images and convert them to a nice 61 MByte large image, 5616 * 3744 pixel in size. The first image was a portrait image of a German politician, Elke Twesten from the state parliament of Lower Saxony. A JPEG version of an image of this series can be found at Wikimedia Commons under a Creative Commons license. Since I used a flash for this image, the quality of the image is reasonably good for comparison purposes and some features of the image, such as hair and the eye can potentially reveal some strengths and weaknesses of the codecs.

I also produced a 1600 pixel and a 640 pixel wide version of the image, since most use cases in the web will not require images with more than 5000*3000 pixels. So for this first run, I end up with three files:

  1. twesten-5616.bmp – 63.078.966 Bytes – md5: b5ce657dc865adc9c16cf1d05d120681
  2. twesten-1600.bmp – 5.116.854 Bytes – md5: eba526672acb7261b2b3112376ace55a
  3. twesten-0640.bmp – 817.974 Bytes - md5: a68aae497299976254142f00be483c45

The webpconv converter tool allows to add a quality parameter ranging from 0 to 100. As the number increases, so does the size of the image and hopefully the quality, too.

Image size of the three twesten images depending on quality parameter

Right now, there is no software available to display .webp files directly. Google Chrome might be getting support for this file format soon, based on the changes in the SVN.

So in order to make easy comparisons, I went ahead and converted the WebP files back to PNG, not adding additional compression artifacts.

The conversion from .bmp to .jpg was done via ImageMagick 6.4.0 with just the quality setting adjusted from 1 to 100. The relationship between quality parameter setting and size is a bit different, please note that the y-axis is already using a logarithmic scale.

JPEG size with the three twesten images depending on the quality parameter setting.

So we basically end up with three times 100 pairs of images, one in JPEG, one in WebP each. Since the quality parameter is not something that can be directly compared to between these formats, there are two approaches for comparison:

  1. Compare the size of two images with the same visual quality.
  2. Compare the visual quality of two images with the same size.

While size is something that can be measured and reasonably be expressed in a single number, quality is in the eye of the beholder. The twesten-0640 images in JPEG range from 2.303 Bytes to 188.898 Bytes, the WebP images range from 1.552 Bytes to 46.638 Bytes. For the range between 2.303 to 46.638 Bytes, there are two reasonably similar files in each format available.

Let’s start with the smallest one: twesten-0640-q13.webp (2303 Bytes) vs twesten-0640-q1.jpeg:

Twesten-0640 at JPEG with quality 1: 2303 Bytes

Twesten 0640 at Webp-Quality 13: 2303 Bytes

Both images do not even remotely qualify as high quality but it is impressive to see how far both images are apart.

The next pair I picked was WebP-q39 with 5736 Bytes and JPEG-q17 with 5754 Bytes respectively.

JPEG Q:17 / Size: 5754 Bytes

WebP Q:39 / Size:5736 Bytes

I still feel confident to declare WebP a winner in this comparison, the quality in the WebP image has now reached a point that no longer causes eye cancer. It is my personal impression that WebP is able to keep the distance to JPEG, a format that is now more than 20 years old.

If anyone thinks there are jpeg converters out there who can produce less terrible results, please let me know. I am more than happy to make my original files available to anyone under a very permissive license term (CC-by or CC-by-sa).

Or you can simply download the twesten-1600.bmp file here.

If you think the image itself was particularly unfair to one format, feel free to release different images (as uncompressed as possible) to allow others to compare their findings. I would love to see a web application where you can upload uncompressed images and receive a selection of JPEG, JPEG2K, JPEG XR and WebP compressed versions in various qualities and sizes.

As Brion rightfully noted, the examples I gave in this post so far are far from realistic, unless you really want to squeeze every bit. When bandwidth is measured in Megabits per second, there is little reason to settle below a certain minimum standard of visual quality, so I would like to give some examples from the upper third.

The Twesten-1600 image starts at 6.647 Bytes (q:0) when compressed with WebP and it ends at 246.970 Bytes (q:100). JPEG is a different beast with q1= 11.733 Bytes to q100=1.125.070 Bytes. I am going to show parts of the images at 400%.

Uncompressed BMP at 400%

JPEG at q=70 / 88912 Bytes / 400%

WebP at q=80 / 77551 Bytes

While being 13% smaller, the visual impression of the WebP image is still better than with JPEG, where artifacts are clearly visible. WebP seems to cover some of these artifacts up by a rather aggressive blurring, detailed structures still survive this process.

Tags: , , , ,

5 Responses to “Preliminary observations regarding the WebP image file format”

  1. skal says:

    Hi,

    nice post!

    Note that WebP decoding has already been added to WebKit (https://bugs.webkit.org/show_bug.cgi?id=47512) and is being worked on at Chromium level next (https://bugs.webkit.org/show_bug.cgi?id=47974)

    Pascal

  2. mpianta says:

    hi , also xnview mp beta 0.31 is able to show webp format http://www.xnview.org

    http://download.xnview.com/XnViewMP-win.zip