Compression for free with pngquant

These days I was looking for some performance gaps on this blog, and I found something essential - I wasn’t taking care of image compression. How obvious, right? 😅

I’ve looked at some alternatives, and I’ve fallen in love with pngquant - a library that significantly reduces file sizes and preserves the quality of files.

The logic of pngquant optimization relies on reducing the number of colors in the image, so it needs to choose some colors to combine and others to remove [1]. That’s what pngquant does with excellence. If you’re curious to understand how pngquant works, I highly recommend the pngquant algorithm [2] section.

From now on, I will use pngquant as the image optimizer for all of my projects. The level of compression sometimes can reach 70%, and the quality lost is almost invisible.


[1] Image Optimisation: What PNGQuant is and why you should use it

[2] pngquant - Algorithm


Wanna talk about this post? @ me on Twitter :-)