2016-01-09 Compress PNG files with pngquant

A little trick if you want to save some space and/or bandwidth; compress your PNG files. Although PNG is a lossless format, you can compress them if the image in question doesn't have a lot of colors. This is often the case when creating screenshots.

In yesterday's screenshot of my terminal window, there's obviously not a whole lot of color. OS X by default saves the image with 24-bits colors, but the image looks perfectly fine with just 8 bits. After compression, file sizes looked as follows:

 -rw-r--r--@ 1 bartvk  staff    88K Jan  8 12:11 Image_2016-01-08_dd_progress.png
 -rw-r--r--  1 bartvk  staff    17K Jan  8 12:13 Image_2016-01-08_dd_progress-fs8.png

That's not so bad. The pngquant homepage is here and on OS X, it's easily installed with a quick

 $ brew install pngquant