ppmtoicr
Convert PPM images to InterColor Registration files
TLDR
Convert a PPM image to a ICR file
Display the output in name
Expand the image by the specified factor
Display the output on the screen with the specified number
SYNOPSIS
ppmtoicr [-verbose] [-size=columns,rows] [ppmfile]
PARAMETERS
-verbose
Displays informative messages about the conversion process, including the progress and details of the generated HDF file.
-size=columns,rows
Specifies the dimensions (width and height) of the image within the HDF file. If this option is omitted, the HDF file will not contain a definition for the image dimensions, which might cause issues for some HDF readers expecting dimension metadata. It does not resize the input PPM image itself but adds metadata to the HDF output.
ppmfile
The path to the input PPM image file. If omitted, ppmtoicr reads the PPM image data from standard input.
DESCRIPTION
ppmtoicr is a specialized command-line utility from the Netpbm suite of graphics tools. Its primary function is to convert a Portable Pixmap (PPM) image into an NCSA Hierarchical Data Format (HDF) raster image, specifically utilizing the Image and Contour Reference (ICR) model within HDF. This tool is often used in scientific and visualization contexts where HDF is a common data storage format for complex datasets. The input is expected to be a standard PPM image, which can be provided via standard input or as a file argument. The output is an HDF file containing the 24-bit RGB image data. It facilitates interoperability between Netpbm's simple image formats and the more complex, structured HDF format used for large datasets.
CAVEATS
ppmtoicr specifically creates a 24-bit RGB raster image within the HDF file. It does not support alpha channels (transparency) or other advanced image features. The NCSA HDF format itself can be complex, and the resulting file might require specific HDF libraries or viewers for proper interpretation. The -size option is crucial for adding dimension metadata to the HDF structure, and its omission can lead to HDF files lacking essential information about the image dimensions, making them unreadable by some applications.
STANDARD INPUT/OUTPUT
Like most Netpbm tools, ppmtoicr is designed to work seamlessly with standard input and standard output. This allows it to be used effectively in shell pipelines, chaining conversions with other commands. For example, cat image.ppm | ppmtoicr > image.hdf.
HISTORY
Part of the extensive Netpbm suite, ppmtoicr dates back to the earlier days of scientific data visualization where the NCSA HDF format was commonly used for sharing complex datasets, including raster images. Its development aligns with the Netpbm project's goal of providing a comprehensive set of tools for converting between various image formats, enabling interoperability across different systems and applications.