Lossy image color space reduction with pngquant

As a website maintainer one usually needs to reduce the average image file size on a website in order to save bandwidth. A tool I just started using on linux is pngquant to reduce the size of my site’s PNG images prior to upload. This is based on a Nairobi linux users group thread.  Pngquant also is available for windows and mac on their website.

In the case of JPEGs I manually convert them to PNGs using gimp or use the convert tool in a one line command to automatically convert all JPEG images to PNGs in a given folder as in this post here.

 convert *.jpg *.png 

Install pngquant and via terminal. I use Ubuntu 16.04.

sudo apt install pngquant

I then use pngquant to reduce the all PNG file sizes in the folder as detailed here.

 pngquant --speed 1 --verbose *.png 


The input image file from a previous post is thus reduced from 47kB to 23kB. Here is a direct visual comparison below:





Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s