LinuxCommandLibrary

pbmtogem

Convert PBM image format to GEM format

TLDR

Convert a PBM image into a GEM .img file

$ pbmtogem [path/to/file.pbm] > [path/to/file.img]
copy

Suppress all informational messages
$ pbmtogem [[-q|-quiet]]
copy

Display version
$ pbmtogem [[-v|-version]]
copy

SYNOPSIS

pbmtogem [pbmfile]

PARAMETERS

-p
    Output an Atari ST palette file. This option is typically used to generate a .PAL file alongside the .IMG file, defining the colors used in the GEM image, though for PBM (monochrome), this might simply output a two-color palette.

-1
    Output only plane 1 (monochrome GEM file). This is the default and most logical conversion for a PBM image, resulting in a single-plane GEM image.

-2
    Output only plane 2. When converting a PBM, this would typically mean the PBM data is placed into the second plane of a multi-plane GEM image, with other planes potentially left blank or filled with default values. This is a highly specific usage.

-4
    Output only plane 4. Similar to -2, this places the PBM data into the fourth plane of a multi-plane GEM image. Also a highly specific usage.

-w
    Output wider than 160 pixels. This option may be used to handle images exceeding a certain width limit common in some older GEM implementations, potentially affecting how pixel data is packed or planes are organized.

DESCRIPTION

The pbmtogem command is a utility within the Netpbm image manipulation toolkit designed to convert Portable BitMap (PBM) image files into the GEM (Graphics Environment Manager) .IMG image format. PBM files represent monochrome images (black and white) using a simple ASCII or raw binary format. The GEM .IMG format was historically used on systems like the Atari ST and Digital Research GEM environment, supporting various graphics modes, including monochrome and color palettes. pbmtogem reads a PBM image from standard input or a specified file and outputs the corresponding GEM .IMG data to standard output. This command is primarily useful for interoperability between modern image systems and legacy GEM-based applications or emulators.

CAVEATS

The GEM .IMG format can be complex, especially with plane interleaving and varying resolutions. While pbmtogem handles the conversion, the resulting image's appearance may depend on the specific GEM environment it's viewed in. The options -1, -2, and -4, while allowing control over plane output, are mostly relevant for understanding the internal structure of GEM files rather than practical use with a monochrome PBM input, where -1 is the natural fit. Using -2 or -4 with a PBM source may result in an image where the content is only visible if the GEM viewer specifically looks at that plane.

HISTORY

pbmtogem is part of the Netpbm project, a comprehensive suite of graphics file format converters and utilities. The Netpbm project originated in the early 1990s as a collection of tools called Pbmplus, developed by Jef Poskanzer. It has since evolved into a widely used, open-source image manipulation toolkit, with pbmtogem being one of its many specialized format conversion tools, reflecting its historical support for various legacy and niche image formats like GEM.

SEE ALSO

gemtoppm(1), pbm(5), netpbm(1)

Copied to clipboard