Posterizer
Version: GIT Web: http://bit.ly/lxf-posterizer
We’ve previously written quite a lot about different encoders, optimisers and the tricks you can do to reduce the size of your image library without compromising quality. It looks like we’re now short of new lossless tools, but still able to blow your mind with some yetvery-good apps for lossy compression.
Lately we’ve come across ImageAlpha, a MacOS-only graphical program that can slim down your PNG files footprint, especially if they have an alpha channel (transparency). That application relied on a command-line tool known as Mediancut-Posterizer, or Posterizer for short. As the author writes, it has two modes: a lossy averaging filter (blurizer) that removes noise from the image; and optimal posterization using Median Cut quantization to reduce the number of unique colours in the image with minimal visual distortion. We ran our own tests and discovered how this tool affected our test true-colour PNGs with transparency. The most common usage probably looked like this: $ posterizer -Q 75 in.png out.png
The program reduced the size of our test image by an impressive 30 per cent without introducing any visible artefacts. Playing with the quality ratio ( -Q ) revealed that even with very low figures Posterizer still produced decent results, and even though the image no longer looked smooth, it was still less than half its original file size. The Posterizer could be very easily turned into a ‘blurizer’ by appending the -b parameter and, again, playing with quality ratio. Lossy averaging didn’t reduce the file size instantly (the output file was larger than the input), but the idea is that averaging alone just prepares the way for further compression. You can re-export a blurred PNG image in Gimp and see how much more the file size can be reduced. There are many ways you can benefit from using Posterizer, besides optimising web sites. For example, Raspberry Pi and many low-power IoT devices will work better with smaller PNG icons and other PNG content.
“The program reduced the image’s size by an impressive 30 per cent”