pcxtoppm
Convert PCX image files to PPM format
TLDR
Convert a PCX file to a PPM image
Use a predefined standard palette even if the PCX file provides one
Print information on the PCX header to stdout
SYNOPSIS
pcxtoppm [pcxfile]
DESCRIPTION
pcxtoppm reads a PCX image file as input and produces a PPM (Portable Pixmap) or PGM (Portable Graymap) image as output. It handles various PCX formats, including 24-bit color, 8-bit color with colormaps, and 1-bit monochrome. For 24-bit PCX files and 8-bit color files with colormaps, it produces a PPM image. For 1-bit monochrome files, it produces a PGM image. The command is part of the Netpbm toolkit, which is a collection of utilities for converting and manipulating various image formats. It's often used as an intermediate step in a larger image processing pipeline, allowing PCX images to be handled by other Netpbm tools or converted to other standard formats.
CAVEATS
pcxtoppm is specifically designed for PCX files; it will not work with other image formats.
pcxtoppm does not offer options to specify output formats other than PPM or PGM directly; it converts to these formats automatically based on the input PCX type.
The command may not support all obscure variations of the PCX format, though it handles the most common ones.
It does not provide options for image manipulation (e.g., resizing, cropping); these operations must be performed by other Netpbm tools.
INPUT AND OUTPUT
pcxtoppm reads a PCX file from standard input if no pcxfile is specified. Otherwise, it reads from the specified pcxfile. The output is always written to standard output in PPM format for color images (24-bit or 8-bit colormapped) or PGM format for monochrome images (1-bit). This design allows for easy piping with other Netpbm tools, following the Unix philosophy.
NETPBM INTEGRATION
As a core component of the Netpbm toolkit, pcxtoppm is designed for seamless interoperability. Its standard output (PPM/PGM) can be directly piped as input to hundreds of other Netpbm utilities for further manipulation (e.g., resizing, rotation), format conversion (e.g., to PNG, JPEG, GIF), or image analysis. This modular design makes it a versatile tool in complex image processing scripts.
HISTORY
pcxtoppm is a component of the Netpbm project, which originated from Jef Poskanzer's PBM (Portable BitMap) utilities in 1988. The Netpbm suite evolved to include PGM (Portable GrayMap) and PPM (Portable PixMap) formats and associated conversion tools. pcxtoppm was developed as part of this suite to handle the popular PCX image format, prevalent in MS-DOS environments, enabling its integration into Unix-like image processing workflows. It exemplifies the Netpbm philosophy of small, specialized tools that can be chained together.