Fundamentals 13 min read

Advances in Image Compression: From JPEG to WebP, HEVC, WXAM, SHARP, and Guetzli Optimizations at Tencent TPS

The article reviews recent developments in image compression formats such as JPEG, WebP, HEVC, and Tencent's proprietary WXAM/SHARP, explains Guetzli's perceptual encoding, details extensive GPU‑based performance optimizations, and demonstrates how these techniques dramatically reduce bandwidth usage in Tencent's massive image storage platform.

Tencent Architect
Tencent Architect
Tencent Architect
Advances in Image Compression: From JPEG to WebP, HEVC, WXAM, SHARP, and Guetzli Optimizations at Tencent TPS

Images have become a visual language for human communication, and reducing data traffic while preserving visual quality remains a hot research topic, leading to formats like JPEG, PNG, GIF, WebP, HEVC, and Tencent's own WXAM and SHARP.

Tencent's TEG Architecture Platform's image storage system (TPS) handles trillions of images and terabytes of bandwidth, continuously evaluating compression formats for compatibility, size, and codec performance.

WebP and HEVC Emergence

Google introduced WebP in 2010, offering a predictive mode that reduces lossily compressed size by 25‑34% compared to JPEG at equal SSIM, and supports transparency with roughly one‑third the size of PNG. WebP gained rapid adoption due to its openness, browser support (Chrome, Opera) and Android compatibility, enabling Tencent to save over 500 GB of bandwidth across many services.

HEVC/H.265 later provided even greater compression (JPEG size reduced to 46%, animated GIFs to 20% of original), but with higher encoding latency and resource consumption. Tencent's teams developed high‑efficiency kernels WXAM and SHARP that outperform open‑source x265 while maintaining speed, later ported to FPGA for further latency reduction.

JPEG Optimization Path

Despite new formats, JPEG still accounts for over one‑third of bandwidth due to legacy compatibility. Tencent adjusts JPEG quantization tables, applies quality‑aware degradation (e.g., for QR‑code‑centric images), and employs Google's Guetzli perceptual encoder, achieving ~30% size reduction without the compatibility issues of WebP.

Guetzli's encoding process involves three iterative stages: (1) finding an optimal global quantization table, (2) identifying zero‑able coefficients per block while preserving visual quality, and (3) aggressively zeroing coefficients with size‑driven back‑tracking, resulting in more consecutive zeros for efficient run‑length coding.

Performance Optimizations

Guetzli's original implementation is computationally intensive, taking >10 seconds per 500×500 image. Tencent accelerated it by parallelizing channel and block operations on GPUs, extending libjpeg‑turbo for full JPEG sampling support, moving Butteraugli calculations to GPU, early‑terminating irrelevant zero‑searches, switching double‑precision to single‑precision where acceptable, optimizing memory allocation with tcmalloc, reducing redundant function calls, and managing GPU contexts and streams for higher throughput.

These optimizations cut average processing latency to under 10% of the original, enabling practical deployment.

Business Deployment

After optimization, Tencent integrated the solution into its image platform using asynchronous compression, persistent storage, and CDN cache control. The architecture supports dynamic format selection, Guetzli‑based processing for uncovered scenarios, and has been rolled out to QQ, WeChat, Tencent Video, and other services, saving over a terabyte of bandwidth and reducing download latency by more than 20%.

Future directions include adopting HEIF/HEVC on iOS devices and further bandwidth‑saving innovations.

GPU Accelerationimage compressionwebpTencentJPEGbandwidth optimizationGuetzli
Tencent Architect
Written by

Tencent Architect

We share insights on storage, computing, networking and explore leading industry technologies together.

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.