pngcrush’s loco crush option


Every PNG image on this blog goes through ImageMagick to create srcset versions, then pngcrush to losslessly optimise them. The savings are routinely upwards of 40% for the same visuals, or 40pc if I go by some bizarre modern style guides.

I was reviewing my dotfile aliases, like a gentleman, and noticed pngcrush had an option I hadn’t noticed before:

-loco ("loco crush" truecolor PNGs)

From the help file:

Make the file more compressible by performing a lossless, reversible, color transformation. The resulting file is a MNG, not a PNG, and should be given the “.mng” file extension. The “loco” option has no effect on grayscale or indexed-color PNG files.

I thought it may have been a neural network trained on locomotives. Trained on locomotives? That was some top-shelf humour.

Portable Network Graphics Now!

Author bio and support


Ruben Schade is a technical writer and infrastructure architect in Sydney, Australia who refers to himself in the third person in bios. Hi!

The site is powered by Hugo, FreeBSD, and OpenZFS on OrionVM, everyone’s favourite bespoke cloud infrastructure provider.

If you found this post helpful or entertaining, you can shout me a coffee or send a comment. Thanks ☺️.