Tuesday, October 12, 2010

Goodbye JPEG - hello WEBP?

Google is introducing a new open-source image format: "WebP" (pronounced ‘weppy’).

Google claims that images in the WebP image format will be close to 40 percent smaller than JPEG files while providing for images that are of higher quality by virtually eliminating the image artifacts associated with JPEG compression. At the present moment, WebP is still in a very early stage of development and hence, unlike the JPEG file format, WebP is not yet built into cameras, web browsers, image-editing programs, etc.

JPEG vs WebP compression at 100%
From left to right: Original image, JPEG compressed, WebP compressed.
JPEG vs WebP compression enlarged
From left to right: Original image, JPEG compressed, WebP compressed.

WebP uses the Y'UV color model that is used in the NTSC, PAL, and SECAM composite color video standards. It is a bit like the LAB mode color model that is used in PhotoShop, and other imaging applications, in that the Y component, like the "L" channel, determines the lightness of the color (referred to as luminance or luma), while the U and V components, like the "a" and "b" channels, determine the color itself (the chroma).
The Y'UV color model - From left to right: Original composite image, "Y" component, "U" component, "V" component.

For image compression, WebP uses the VP8 video codec - the same methodology that is used to compress keyframes in videos. This codec uses predictive coding to encode an image by using the values in neighboring blocks of pixels to predict the values in a block, and then encodes only the difference (residual) between the actual values and the prediction. The residuals typically contain many zero values, which can be compressed much more effectively.

So far, while it is still a "lossy" compression technology, WebP compressed images certainly appear to deliver a higher level of compression (and thus smaller file size), and much higher image quality than the current standard JPEG image compression method. This is a good thing, not only for images for web application, but possibly for print application as well.

Google Chrome will likely be the first consumer application to support "weppy" compression in order to provide a faster user experience on web sites while reducing bandwidth and hosting costs.

On the other hand

Since the Y'UV color model is similar in principal to the Lab color model...why not apply the same compression methodology to an image that's in Lab mode? I've done some testing with high JPEG compression of the "a" and "b" channels of a Lab image and easily achieve file sizes that are only 20% of the original file size with no apparent image degradation. In fact they look very similar to the results obtained with the WebP image format.
Left image WebP - right image Lab compressed using very high JPEG compression for the "a" and "b" channels of an Lab image.

Left image WebP - right image Lab compressed using very high JPEG compression for the "a" and "b" channels of an Lab image.

If the Y'UV compression method could be applied to Lab images then the graphic arts industry could continue to use a color model that is well understood and in use today rather than import a new color model from another industry.

No comments:

Post a Comment