[PNG] PNM/PAM to PNG image converter

  Pnmtopng / Pngtopnm
[pnmtopng] Pnmtopng / pngtopnm was what everything started with. Co-developed by Alex Lehmann and Willem van Schaik (me :-) in 1995, it enables, through the conversion to/from PbmPlus files, the support of nearly any graphics format on the planet. At the same time, pnmtopng was in the early days of PNG one of the better optimized converters, resulting in well compressed PNG files. Originally developed on Unix, it requires netpbm, libpng and zlib to be built.

Download the latest pnmtopng sources, but then also get the libpng library (or here), and the zlib and netpbm sources. Or just start with the readme-file.

[pam2png] When pnmtopng/pngtopnm was written, NetPBM didn't have a format to support alpha channel transparency. Since then that has changed, it's called the PAM format. Which supports any number of channels, not necessarily alpha. Updating pnmtopng to pamtopng is still one of my planned projects, but I didn't have time yet to do that.

Because I needed such a tool for an urgent 3D graphics project, I wrote a quick and dirty pam2png tool, using the sources from pnm2png in PngMinus. So this is a stop-gap solution, but if you simply want to convert 8 bit RGBA or GrayAlpha images it does the job.

Download the pam2png tar-ball, which contains both source code and a Linux binary.

  Windows / MS-DOS executables
[pnmtopng for MS-DOS] For those of you that run on Windows/DOS, problem with the PbmPlus tools has always been that netpbm never got ported to DOS, Windows or NT. So, you can not build the program using Borland's compiler or Visual-C. However, using the gnuwin libraries, you can now compile pnmtopng and pngtopnm to a Windows command-line utility. If you just want the executables, just download the zip-file and you are ready to go.

An older variant was the built Alex did with DJGPP, relying on DPMI as a DOS extender. Just grab the package and unzip it. Notice the cwsdmpi.exe executable, which must be in the current directory or in your PATH. Run pnmtopng.exe / pngtopnm.exe in an MS-DOS box or after rebooting in DOS.

  Pnm2png / Png2pnm
[pngminus] As said, pnmtopng requires PbmPlus / netpbm to be built. And not everybody wants to or is able to get that library in shape. Also, libpng and zlib are available on more platforms than netpbm. Therefore I wrote PngMinus, with the pnm2png and png2pnm converter utilities, that has built-in functions to read ppm/pgm/pbm files. But it is also more limited related to the size of the files it can handle.

The package comes with build scripts to compile PngMinus on Linux using gcc or on MS-DOS using Borland's Turbo-C 3.0. Which doesn't mean that it is limited to that, for example I also compiled it successfully using Visual-C. You can download the sources from this site, but the package is also included with libpng, where you will find it in the "contrib" folder.

For those who just want some MS-DOS binaries, this zip-file contains two executables that also run fine in a Windows DOS-box. I have also included two libpng and zlib library files, precompiled for the MS-DOS platform. With the two zip-files together, you are all set to go without the need for any other packages.

[PNG page] [Download page] [png] [PngSuite]

  Willem van Schaik, Calgary, June 2001     http://www.schaik.com/wwwillem.html