May 21, 2011

Google WebP, How much Loss in Quality?

With Google WebP, how much loss in quality?

Google WebP is a new image format for the web that implements lossy compression. Per Google, WebP images are, about, 40% smaller than jpeg images of similar quality. An impressive reduction! 

Web pages with WebP images will load faster and create a better user experience. Imagine much faster loading of websites while using Google Chromebook or Android devices. Since WebP is a lossy compression there will be some loss of quality. But how much loss in quality is there with WebP?  Can a person tell the difference? How about a program?

What follows is a simple test to check the WebP image quality –

Google has provided sample images to display the quality. Three versions are provided for each image – the png source, jpeg and webp. e.g. pick the first image of Norway (also displayed above).
 png – 450 KB
 jpg – 43.84 KB
 webp – 29.61 KB

Visually all the images look the same – an impressive performance by WebP.

Now use the FastStone image viewer to analyze each image. Since FastStone does not support webp format yet, do the following for each image and compare the results

  1. Click image to display in full-size
  2. Use FastStone screen capture to capture the displayed image in lossless, png format
    File > Screen Capture > Capture Rectangle Region
  3. Analyze the saved image
    View > Histogram    (Luminosity)
    View > Histogram > # of colors

# of colors – 104,807


# of colors – 65,300


 # of colors – 45,748

With jpeg, there is a 1.6x loss in quality – the 104,807 colors in the source get reduced to 65,300.

While with webp, there is a 2.3x loss in quality – 104,807 colors in the source get reduced to 45,478.

The webp color histogram also looks much rougher than png or jpg.

So, in this example, while webp image size is 50% smaller image than jpeg (Good!), the webp photo quality is 43% worse than jpeg (Bad!). Of course, these are mathematical results. Visually, for these low resolution photos, it is hard to tell the difference.