Switching
Image formats

WebP vs PNG: Choosing Lossless Formats and File Size Optimization

A detailed comparison of WebP Lossless and PNG formats. Discover why WebP Lossless is smaller than PNG at identical visual quality, and learn how to optimize your assets.

June 29, 2026· Last updated September 3, 2026

Lossless WebP discards no pixels, exactly like PNG, but uses more sophisticated predictive compression to produce much smaller files. In our measurements a screenshot was 94KB as PNG and 17KB as lossless WebP, less than a fifth, and a flat graphic went from 23KB to 9KB. For images that live on the web, choose WebP; keep PNG for submissions and anywhere compatibility matters.

For web designers and developers, PNG has long been the default format for high-quality lossless images with transparent backgrounds. However, WebP's lossless compression has changed the rules by offering significantly smaller file sizes. Here is how to choose the right format to optimize your web application.

The Tech Behind WebP Lossless

According to Google's data, WebP Lossless files are 26% smaller than PNGs at identical visual quality. WebP achieves this through predictive coding: it analyzes neighboring pixel blocks to predict color values and only stores the difference. This allows it to save lossless color channels much more densely.

Why PNG Still Exists

Despite WebP's size advantages, PNG remains a dominant standard due to its unmatched compatibility across older systems:

  • Legacy Software: Older versions of photo editors or printing machine software might not open WebP files natively without plugins.
  • Older Devices: Certain legacy mobile devices or ancient web browsers do not support WebP, requiring PNG as a fallback image.

Measured: bytes needed to store identical pixels

Between two lossless formats the picture is identical, so file size is the only thing left to compare. We saved three sources as PNG and as lossless WebP and read the actual byte counts.

Source typePNGWebP (lossless)Saving
Photograph3,591 KB1,603 KB55% smaller
Flat graphic23 KB9 KB59% smaller
Screenshot94 KB17 KB82% smaller
Both formats preserve every pixel, so the images are visually identical. Measured by encoding three 1600x1067 (1.71MP) sources with libvips 8.18.3 and reading the actual byte counts.

Lossless WebP is smaller in all three cases, and the gap is widest on the screenshot: 94 KB as PNG falls to 17 KB, removing 82% of the file. WebP's predictive compression works especially well on images where the same patterns repeat, such as text and interface elements.

Optimization Best Practices

The recommended approach is to keep your master design assets as high-quality PNGs for editing and backup, then convert them to WebP for production web deployment. Using a local browser-side converter like Switching allows you to instantly encode PNGs to WebP, saving valuable bandwidth and speed.

Frequently asked questions

How can a file be smaller with no loss?
It is a difference in algorithms. WebP predicts each pixel from its neighbors and records only the error, and it does so more cleverly than PNG. Nothing is discarded, only represented more efficiently, so decoding reproduces the original exactly.
Does WebP support transparency?
Yes, in both lossy and lossless modes. Lossy WebP can even keep an alpha channel while shrinking the file, which makes it far better than PNG for photographic images that need a transparent background.
So is PNG obsolete?
Not outside the web. Government forms, older editors, and print shop rules sometimes reject WebP, and an emailed WebP may not open on the recipient's machine. Splitting the job, WebP for the web and PNG for handing to people, is the practical approach.
Does converting PNG to WebP reduce quality?
Not in lossless mode; the pixel values are reproduced identically. Be aware that some converters default to lossy mode, so check that the lossless option is actually enabled.

Explore related tools