pnmtopam
Convert PNM image to PAM image format
SYNOPSIS
pnmtopam [pnmfile]
PARAMETERS
pnmfile
The input PNM file. If not specified, pnmtopam reads from standard input.
DESCRIPTION
The pnmtopam command converts a PNM (Portable Any Map) image to a PAM (Portable Arbitrary Map) image. PNM is a family of simple bitmap image formats: PBM (black and white), PGM (grayscale), and PPM (color). PAM is a more general format that can represent images with arbitrary depth, tuple type, and height. pnmtopam provides a straightforward way to transition older PNM images into this more flexible format. The conversion preserves image data while changing the file header and format. It is part of the Netpbm suite, a collection of command-line image manipulation tools commonly used in scripting and image processing pipelines.
It can be used to take multiple PBM, PGM, or PPM files and combine them into a PAM with a single plane. This is helpful because some programs require a PAM image, but the original images you have are in PNM format. For example, you may have a grayscale image that you want to use as an alpha channel for another image. You can convert the grayscale image to a PAM and then use pamcomp to composite the two images together.
EXIT STATUS
pnmtopam returns 0 if it succeeds, and a positive number if it fails.
HISTORY
The pnmtopam command is part of the Netpbm suite, a collection of image manipulation tools that dates back to the early 1990s. The Netpbm suite was designed to provide a portable and simple way to perform common image operations, and pnmtopam plays a key role in converting images into a more flexible format compatible with other Netpbm tools.