DEV Community

Jacob Enders
Jacob Enders

Posted on

PNG can have better compression and quality than WebP

If you have flat color images with a very limited color range, you should consider sticking with the PNG file format. There is a tool PNGQUANT that can offer superior compression and quality to googles CWEBP tool.

Here are my general findings, let me know in the comments if there are better commands I should be using for CWEBP to make it perform as well as PNGQUANT.

Base Image: 284.1kB PNG
Image description

Command: cwebp -near_lossless 0 -z 9 original.png -o o.webp
Result: 80.8kB WEBP
Opinion: Text looks decently crisp & it is compressed.

Image description
Image description
Image description

Command: pngqaunt original.png --quality=0-50 -s1 -o o.png
Result: 54.4kB PNG
Opinion: Text looks even better & it is even more compressed.

Image description
Image description

Image description

Command: cwebp -q 35 original.png -o o.webp
Result: 53.7kB WebP
Opinion: The text looks worse, there is ugly artifacting & the compression doesn't even beat the PNG.

Image description
Image description
Image description

Conclusion: PNGQUANT provides the best image and compression quality for the specific types of images I need to store. I need to store many thousands of flat color images, so every kB counts.

Top comments (0)