pbmtopng
Convert PBM image to PNG image
SYNOPSIS
pbmtopng [pbmfile]
PARAMETERS
[pbmfile]
The input PBM, PGM, or PPM file. If not specified, pbmtopng reads from standard input.
DESCRIPTION
The pbmtopng command converts a Portable BitMap (PBM), Portable GrayMap (PGM), or Portable PixMap (PPM) image to a PNG (Portable Network Graphics) image. It reads the input PBM/PGM/PPM image from standard input and writes the resulting PNG image to standard output. This utility is part of the Netpbm suite, a collection of tools for manipulating images in various formats. pbmtopng is a simple yet effective tool for converting image formats and making them compatible with applications that support PNG.
It effectively creates a lossless compression, making them suitable for high-quality image storage and display. The command automatically handles color depth and other image attributes, providing a straightforward way to convert from PBM/PGM/PPM to PNG.
USAGE EXAMPLE
To convert a PBM file named 'input.pbm' to a PNG file named 'output.png', you can use the following command:
pbmtopng input.pbm > output.png
ERROR HANDLING
If the input file is not a valid PBM, PGM, or PPM image, pbmtopng will output an error message to standard error. Also, if the user don't have write permissions in the output directory, the output file won't be created.
HISTORY
pbmtopng is a part of the Netpbm suite, which originated in the late 1980s. Netpbm and its tools like pbmtopng quickly became essential for image format conversion within the Unix environment. Over time, Netpbm and pbmtopng have remained relevant because of their simple, robust design and support for a variety of image formats.
SEE ALSO
pngtopnm(1), pbm(5), pgm(5), ppm(5)