hipstopgm
Convert HIP files to Portable Graymap (PGM)
TLDR
Convert a HIPS file into a PGM image
Suppress all informational messages
Display version
SYNOPSIS
hipstopgm [-force] [-invert] [-width=W] [-height=H] [-dpi=D] [-gamma=G] [filename]
PARAMETERS
-force
Bypasses the initial check for a valid PCL stream signature and attempts to convert the input regardless, which can be useful for unusual or malformed PCL data.
-invert
Flips the black and white values of the output image, making black pixels white and white pixels black.
-width=W
Explicitly sets the width of the output PGM image in pixels. If not specified, hipstopgm attempts to determine the width from the PCL stream; otherwise, it defaults to 1000 pixels.
-height=H
Explicitly sets the height of the output PGM image in pixels. If not specified, hipstopgm attempts to determine the height from the PCL stream; otherwise, it defaults to 1000 pixels.
-dpi=D
Specifies the resolution of the image in dots per inch. If not specified, hipstopgm tries to extract this information from the PCL stream; otherwise, it defaults to 300 DPI.
-gamma=G
Applies gamma correction to the output image. G is a floating-point value, with a default of 1.0 (no correction).
filename
The path to the HP-PCL input file. If omitted, hipstopgm reads its input from standard input (stdin).
DESCRIPTION
hipstopgm is a specialized utility within the Netpbm image processing suite, designed to convert monochrome bitmap data embedded within HP-PCL (Printer Command Language) streams into the Portable GreyMap (PGM) format. This command is particularly useful for extracting and processing image components from documents originally destined for HP-PCL compatible printers, such as those using HP-GL/2 or PCL 5. It reads the PCL data, typically from standard input, identifies and extracts the bitmap, and outputs a corresponding PGM image to standard output. While PGM is a grayscale format, hipstopgm effectively represents the black and white nature of the input monochrome bitmap. It serves as a crucial bridge for integrating PCL-based image data into broader image manipulation workflows supported by Netpbm and other graphic tools.
CAVEATS
hipstopgm is specifically designed for monochrome HP-PCL bitmaps and will not process color PCL data. If no bitmap is found in the input stream, or if the stream is not recognized as PCL, the command may warn and exit. Default dimensions and DPI (1000x1000 pixels, 300 DPI) are used if the PCL stream does not provide this information.
STANDARD INPUT/OUTPUT
By default, hipstopgm reads HP-PCL data from standard input (stdin) and writes the resulting PGM image to standard output (stdout). This design allows for seamless integration into shell pipelines, enabling complex image processing workflows by chaining multiple Netpbm utilities.
BITMAP DETECTION
The command attempts to detect and extract a valid monochrome bitmap from the HP-PCL stream. If it cannot find a bitmap or if the input is malformed, it will typically issue a warning message and terminate, preventing the generation of invalid output.
HISTORY
hipstopgm is a component of the comprehensive Netpbm toolkit, which originated from Jef Poskanzer's pbmplus package in the late 1980s. This specific utility was derived from pcltoppm by Brian Deal, reflecting Netpbm's ongoing development to support conversions for a wide array of legacy and specialized image formats, including those used by various printer languages.