Is Lossless WebP Better Than PNG in Compression?

WebP lossless compression consistently delivers higher compression ratios than PNG, producing files that are on average 20% to 30% smaller while preserving pixel-perfect visual fidelity. Designed specifically by Google as a modern alternative to legacy formats, lossless WebP incorporates advanced prediction techniques, localized color transformations, and optimized entropy coding that surpass the standard DEFLATE algorithm used by PNG. This article examines the benchmark numbers between the two formats, the underlying compression mechanics that create this efficiency gap, and the trade-offs involving encoding speed and hardware compatibility.

Compression Ratio and File Size Benchmarks

Across standard web benchmarks and large-scale dataset evaluations, WebP lossless outperforms standard PNG encoders by a noticeable margin. Google’s empirical research found that WebP lossless images are roughly 26% smaller compared to the same images compressed with standard PNG tools. Even when PNGs are pre-processed with aggressive, compute-intensive recompression utilities like PNGOUT or Zopfli, WebP lossless still maintains a 15% to 22% size advantage.

The compression margin varies depending on the nature of the graphic:

Why WebP Achieves Higher Compression Ratios

PNG relies primarily on two stages: a set of five row-by-row predictive filter types (None, Sub, Up, Average, and Paeth) followed by LZ77 and Huffman coding via the DEFLATE algorithm. Lossless WebP replaces and expands this pipeline using several specialized spatial and color transforms:

  1. Spatial Prediction: WebP uses 14 distinct spatial prediction modes applied on localized sub-blocks rather than whole rows, predicting pixel values using neighboring pixels above and to the left.
  2. Color (Cross-Color) Transform: Color channels often correlate. WebP decorrelates the red and blue channels based on the green channel, flattening unnecessary data variance.
  3. Color Cache and Local Palettes: WebP maintains a dynamically updated color cache of recently seen pixels and checks if tiny image sub-regions can be represented by localized sub-palettes of fewer than 16 colors.
  4. 2D Locality-Aware LZ77: Unlike PNG's linear byte stream backward references, WebP can reference matching pixel runs within a two-dimensional spatial window.
  5. Modified ANS Entropy Coding: WebP uses advanced entropy modeling that clusters entropy tables, allowing different image regions with varying complexity to be encoded with dedicated statistical models.

Encoding Speed, Decoding Speed, and Resource Overhead

The primary trade-off for WebP’s superior compression ratio lies in computational cost during encoding.

Browser Support and Practical Implementation

Modern web ecosystems universally support WebP across all major browsers, including Chrome, Safari, Firefox, and Edge. For web delivery, substituting lossless WebP for PNG directly lowers bandwidth consumption, improves Largest Contentful Paint (LCP) metrics, and reduces server storage needs while retaining identical image quality. PNG remains primarily advantageous in legacy workflows, print production chains, and editing environments where specific third-party desktop tools do not natively ingest WebP containers.