Friday Dec 30, 2016

PAM to PNG Converter

Five years ago I wrote on this blog (just scroll down) about a "Quick & Dirty" pam2png utility to add alpha channel handling to pnmtopng. Which is part of the NetPBM graphics toolset in Linux. The pnmtopng software has over a lifetime of twenty years seen so many revisions — by different people with different visions — that it was time for a full rewrite. Which I finally did a year or so ago.

Over those years the code nearly doubled in size. With pamtopng I brought it back to a quarter of the current pnmtopng. Because today computers are so much faster than twenty years ago and because memory is now plentiful, all kinds of very clever but complex optimizations to compress the PNG image could be removed. (And if you need maximum compression, there is always pngcrush.) Also 60% of the command-line switches were dropped.

More detailed information about pamtopng can be found on the man-page at SourceForge. Which is also the place to find the source code. Because of the NetPBM software "Release System", when it comes to Linux distro's pamtopng will not always be included. For example it is part of Fedora since version 23, but you won't find it yet in CentOS.