Minimum unique abbreviation of option is acceptable. You may use double hyphens instead of single hyphen to denote options. You may use white space in place of the equals sign to separate an option name from its value.
This program is part of Netpbm.
pngtopnm reads a PNG image (Portable Network Graphics) as input and produces a PPM image as output. The type of the output file depends on the input file - if it's black & white, pngtopnm creates a PBM file. If it's grayscale, pngtopnm creates a PGM file. Otherwise, it creates a PPM file.
If you want even more information about the PNG image, use pngcheck (not part of Netpbm).
color is as described for the argument of the ppm_parsecolor() library routine.
Examples:
If you don't specify -background, the background color is what is specified in the PNG image, and if the PNG doesn't specify anything, white.
You cannot specify -background unless you also specify -mix. Before Netpbm 10.27 (March 2005), you could specify -background with -mix and it was just ignored. (This caused a usability problem).
Because the gammas of uncompensated monitors are around 2.6, which results in an image-gamma of 0.45, some typical situations are: when the image-gamma is 0.45 (use -verbose to check) and the picture is too light, your system is gamma-corrected, so convert with "-gamma 1.0". When no gAMA chunk is present or the image-gamma is 1.0, use 2.2 to make the picture lighter and 0.45 to make the picture darker.
For information on the PNG format, see http://schaik.com/png.
A PNG image contains a lot of information that can't be represented in Netpbm formats. Therefore, you lose information when you convert to another format with "pngtopnm | pnmtoxxx". If there is a specialized converter that converts directly to the other format, e.g. ptot to convert from PNG to TIFF, you'll get better results using that.
The program could be much faster, with a bit of code optimizing. As with any Netpbm program, speed always takes a back seat to quick present and future development.