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 . That’s what pngquant does with excellence. If you’re curious to understand how pngquant works, I highly recommend the pngquant algorithm  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.