gemtopnm
Convert GEM image files to PNM images
TLDR
Convert a GEM image file to a PNM image
Describe the contents of the specified GEM image
Display version
SYNOPSIS
gemtopnm [options] [gemfile]
Options: [-b] [-t] [-x XPOS] [-y YPOS] [-w WIDTH] [-h HEIGHT]
PARAMETERS
gemfile
The path to the input GEM .img file. If omitted, gemtopnm reads from standard input.
-b
When processing monochrome images, interpret the pixel color index 0 as the background color. This can invert the appearance of some monochrome images.
-t
When processing monochrome images, interpret the pixel color index 0 as the target (foreground) color. This is typically the default behavior.
-x XPOS
Specify the X-coordinate of the top-left corner for cropping the output image. The default is 0.
-y YPOS
Specify the Y-coordinate of the top-left corner for cropping the output image. The default is 0.
-w WIDTH
Specify the width for cropping the output image. If not specified, the full width of the input image from XPOS is used.
-h HEIGHT
Specify the height for cropping the output image. If not specified, the full height of the input image from YPOS is used.
DESCRIPTION
gemtopnm is a utility that reads a Graphics Environment Manager (GEM) .img raster image file and converts it into a Portable Anymap (PNM) format image, which is then written to standard output.
It supports various GEM image types, including monochrome, 2-color, and 16-color files. Monochrome and 2-color images are converted to Portable Bitmaps (PBM), while 16-color images are converted to Portable Pixmaps (PPM). The tool can handle both screen dump files and printer-specific GEM .img files.
It is particularly useful for users needing to process legacy GEM graphics on modern Unix-like systems, enabling integration with other image manipulation tools within the Netpbm suite.
CAVEATS
The GEM .img format can have variations; gemtopnm might not support all specific permutations or non-standard .img files.
It always outputs to standard output, so redirection (e.g., `>`) is necessary to save the image to a file.
Color handling is limited to monochrome, 2-color, and 16-color, reflecting the capabilities of the original GEM graphics environment.
INPUT/OUTPUT
gemtopnm reads the GEM .img file from the filename specified as an argument or from standard input if no filename is provided. The resulting PNM image is always written to standard output. Therefore, to save the output, you typically need to redirect it to a file, for example: `gemtopnm image.img > image.pnm`.
OUTPUT IMAGE TYPES
Depending on the color depth of the input GEM image, gemtopnm automatically produces either a Portable Bitmap (PBM) for monochrome and 2-color images or a Portable Pixmap (PPM) for 16-color images. The output PNM type is chosen to best represent the original GEM image data, ensuring compatibility with other Netpbm tools.
HISTORY
gemtopnm is a component of the Netpbm project, a comprehensive toolkit for manipulating graphical images that originated in the early 1990s as Pbmplus. It was developed to handle the GEM .img format, which was prevalent on systems like the Atari ST and early PC graphical environments, making these legacy images accessible and convertible to more common formats. The Netpbm suite, including gemtopnm, has been continuously maintained and expanded by various contributors, with Bryan Henderson being a key figure in recent decades.