leaftoppm
Convert Macintosh QuickDraw PICT files to PPM
TLDR
Generate a PPM image file as output for an Interleaf image file as input
Display version
SYNOPSIS
leaftoppm [leaf_file]
PARAMETERS
leaf_file
The path to the CALS Group 4 LEAF format image file to be converted. If this argument is omitted, leaftoppm reads the input from standard input.
DESCRIPTION
leaftoppm is a utility from the Netpbm suite, designed to convert image files stored in the CALS Group 4 LEAF format into the Netpbm PPM (Portable Pixmap) format. The LEAF format, often used for monochrome scanned documents and engineering drawings, employs a specialized Group 4 fax encoding for compression. leaftoppm decodes this compressed data and outputs a black-and-white or grayscale image in the PPM format.
This tool is particularly useful for handling legacy scanned documents or specialized technical drawings that utilize the CALS Group 4 standard. As part of the versatile Netpbm ecosystem, the resulting PPM image can be easily piped to other Netpbm tools for further processing, such as scaling, cropping, or conversion to more common image formats like PNG, JPEG, or GIF using commands like ppmtogif or ppmtopng.
CAVEATS
Specific Input Format: leaftoppm exclusively processes CALS Group 4 LEAF files. It will not work with other image formats.
Raw Output Format: The output is in the raw PPM (Portable Pixmap) format, which is primarily an intermediate format within the Netpbm suite. Further conversion is usually required for viewing or sharing in more common formats.
Monochrome/Grayscale Output: As LEAF files are typically monochrome (black and white), the output PPM image will reflect this, usually as a grayscale or 1-bit deep image.
Netpbm Dependency: This command is an integral part of the Netpbm package and is designed to work within that ecosystem, rather than as a standalone general-purpose image converter.
STANDARD INPUT/OUTPUT
True to the Unix philosophy, leaftoppm operates seamlessly with standard input and output. If the leaf_file argument is omitted, the command reads the CALS Group 4 LEAF data directly from standard input. The converted PPM image is always written to standard output. This design allows for efficient piping operations, enabling chaining with other commands (e.g., cat image.leaf | leaftoppm | ppmtopng > image.png).
NETPBM SUITE INTEGRATION
leaftoppm is specifically designed to function as an integral part of the larger Netpbm toolchain. Its output (the PPM format) is immediately compatible with numerous other Netpbm utilities. This allows users to perform subsequent operations such as resizing, cropping, color adjustments, or conversion to popular formats like PNG, JPEG, or GIF by simply piping the output of leaftoppm to another Netpbm command.
HISTORY
leaftoppm is a component of the long-standing Netpbm project, which originated in the early 1990s as pbmplus. The Netpbm suite provides a comprehensive collection of tools for manipulating graphic images, primarily based on the PPM, PGM, PBM, and later PAM formats.
leaftoppm was developed to specifically address the conversion of images conforming to the CALS Group 4 standard, a format frequently encountered with scanned engineering documents, technical publications, and government standards. Its inclusion underscores Netpbm's commitment to supporting a wide array of image formats, including more specialized or legacy ones, ensuring interoperability within diverse document and imaging workflows.