Fundamentals 18 min read

Evaluation of Image Compression Formats and Algorithms: Guetzli, WebP, MozJPEG, and Libjpeg‑Turbo

The article presents a comprehensive evaluation of common image formats and compression algorithms—including Guetzli, WebP, MozJPEG, and Libjpeg‑Turbo—by comparing their compression ratios, quality metrics, encoding speed, and practical deployment considerations for large‑scale mobile services.

High Availability Architecture
High Availability Architecture
High Availability Architecture
Evaluation of Image Compression Formats and Algorithms: Guetzli, WebP, MozJPEG, and Libjpeg‑Turbo

Background

With the rapid growth of image traffic on the Internet, reducing image size while preserving visual quality has become a critical challenge for large‑scale services. Meitu, a mobile‑focused company, primarily uses JPEG and PNG, which have distinct trade‑offs in lossiness and transparency.

Research on JPEG Alternatives

Guetzli : Google’s open‑source JPEG encoder that leverages the Butteraugli perceptual metric to guide encoding, achieving 20‑30% smaller files than libjpeg at the cost of several‑fold higher CPU and memory usage (≈300 MB for a 1 MP image). It is unsuitable for latency‑sensitive services but may be viable for non‑real‑time workloads such as splash‑screen ads.

WebP Overview

WebP, derived from the VP8 video codec, supports both lossy and lossless compression as well as animation and alpha transparency. Official claims state 25‑34% size reduction over JPEG for comparable quality, while independent measurements report up to 45% reduction versus PNG.

Lossy Compression Principle

WebP’s lossy pipeline mirrors JPEG (color space conversion, block partitioning, prediction, FDCT, quantization, zig‑zag ordering, entropy coding) but improves prediction using VP8 intra‑frame models and employs adaptive block partitioning and Boolean arithmetic coding, yielding an extra 5‑10% compression gain.

Business Adoption and Compatibility

WebP is deployed in Google services (YouTube, Gmail, Play Store) and adopted by major platforms such as Facebook, eBay, Taobao, and Tencent. As of the article’s writing, roughly 73% of global users and 61% of Chinese users can view WebP natively, with support in Chrome, Android, and emerging support in Safari, Firefox, and iOS libraries.

Comparative Tests

Test 1 – Bits‑Per‑Pixel vs. SSIM

Using a 100‑image e‑commerce set and a 50‑image ad set, the authors measured BPP and SSIM for Libjpeg‑Turbo, MozJPEG, and WebP (Libwebp‑0.6.0). WebP consistently required fewer bits per pixel for the same SSIM range.

Test 2 – Quality vs. File Size

WebP was encoded at quality levels 65, 75, and 85; corresponding MozJPEG and Turbo images were produced to match SSIM. Results showed WebP achieving smaller file sizes at comparable quality.

Test 3 – Encoding Time

Encoding time was recorded for the same quality settings; WebP’s time was higher than MozJPEG/Turbo but still acceptable for many batch‑processing scenarios.

Test 4 – Guetzli on PNG

Guetzli was evaluated on a 512×512 PNG (Lena). While Guetzli delivered superior quality at high settings (84‑110), its encoding time was markedly longer, limiting its use to high‑quality, low‑throughput cases.

Guidance and Recommendations

Overall, WebP outperforms MozJPEG, which in turn outperforms Libjpeg‑Turbo. Deploying WebP can save >20% bandwidth for Meitu’s image‑heavy services. The authors recommend using a quality setting of 75 (‑q=75) as a sweet spot for e‑commerce images, optionally increasing the compression effort with ‑m=6 for an additional ~7.6% size reduction at ~80% extra CPU cost.

Color Difference Issue

Direct JPEG‑to‑WebP conversion can introduce a reddish tint because JPEG uses YUVJ420P (full 0‑255 range) while WebP uses YUV420P (16‑235 range). Adding the “‑metadata all” flag preserves original EXIF/ICC data and eliminates the color shift.

SSIM Limitations

For images dominated by large solid‑color regions, SSIM may remain high (>0.98) even when visual quality is poor. In such cases, higher quality settings are required, indicating that SSIM alone is insufficient for quality assessment.

Other Information

Tools used for evaluation include SSIM, DSSIM, and Butteraugli. Deployment resources for Android (webp‑android‑backport), iOS, and JavaScript are listed, along with links to compatibility tables and issue trackers.

References

https://github.com/google/guetzli

https://github.com/google/butteraugli

http://caniuse.com/#search=webp

https://developers.google.com/speed/webp/

https://zhuanlan.zhihu.com/p/23648251

https://research.googleblog.com/2017/03/announcing-guetzli-new-open-source-jpeg.html

Author

Liu Zhihui, Meitu Architecture Platform Engineer, responsible for backend services, codec development, live streaming, and virtualization. Recruitment information is included at the end of the original article.

performance testingimage compressionwebpSSIMJPEGGuetzlicodec evaluation
High Availability Architecture
Written by

High Availability Architecture

Official account for High Availability Architecture.

0 followers
Reader feedback

How this landed with the community

login Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.