Friday, October 1, 2010

WebP vs JPEG

WebP is a method of lossy image compression and is an open source format like WebM. Due to its prediction coding and better entropy coding, it may save around 40% of bits, comparing to JPEG.

A WebP file consists of VP8 image data, i.e., a VP8 intra frame, and a container based on RIFF. JPEG uses JIF container.

WebP uses predictive coding to encode an image, the same methodology used by the VP8 video codec to compress keyframes in videos. Predictive coding uses 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. The residuals are then transformed, quantized and entropy-coded as usual. WebP also uses variable block sizes, 4x4 and 16x16. However, 4x4 transform tends to blur and lose more image detail than JPEG 8x8 transform. JPEG does not support intra prediction, but JPEG has more features, such as YUV 444 and YUV 422, while WebP only supports YUV 420 which is not good for text encoding. JPEG also supports lossless coding.

Google provided a comparative study of JPEG, WebP, and JPEG 2000:

An image encoded with WebP.

This image has been encoded with WebP. Because browsers can't show WebP natively today, this WebP image actually is displayed here as a PNG graphic that captures the WebP version without changes. In its WebP incarnation, the image is 36,154 bytes.

(Credit: Google)
An image encoded with JPEG. Its file size is 46768 bytes.

The same image encoded with JPEG. Its file size is 46,768 bytes.

(Credit: Google)

Google released a conversion tool to convert images to WebP format.

No comments:


Blog Archive

About Me

My photo
HD Multimedia Technology player