DEV Community

Jacob Enders
Jacob Enders

Posted on

1

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.

Image of Docusign

Bring your solution into Docusign. Reach over 1.6M customers.

Docusign is now extensible. Overcome challenges with disconnected products and inaccessible data by bringing your solutions into Docusign and publishing to 1.6M customers in the App Center.

Learn more

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs