LinuxCommandLibrary

pgmtosbig

Convert portable graymap (PGM) images to SBIG

TLDR

Convert a PGM image file to the SBIG CCDOPS format

$ pgmtosbig [path/to/input_file.pgm] > [path/to/output.sbig]
copy

SYNOPSIS

pgmtosbig [-size=size] [-xsize=xsize] [-ysize=ysize] [-xysize=xsize,ysize] [pgmfile]

PARAMETERS

-size=size
    Sets both the X (width) and Y (height) dimensions of the output SBig image to the specified value.

-xsize=xsize
    Sets the X (width) dimension of the output SBig image.

-ysize=ysize
    Sets the Y (height) dimension of the output SBig image.

-xysize=xsize,ysize
    Sets both the X (width) and Y (height) dimensions of the output SBig image using a comma-separated pair.

pgmfile
    The path to the input Portable Graymap (PGM) file. If not specified, pgmtosbig reads the PGM data from standard input.

DESCRIPTION

pgmtosbig is a Netpbm utility that transforms a Portable Graymap (PGM) image into a specialized "SBig" format. This format was historically used for displaying images on high-resolution devices or systems that specifically understood this binary big-endian image representation. The command reads a PGM image either from a specified file or from standard input, and it writes the resulting SBig data to standard output.

It is often used in conjunction with sbigtopgm, which performs the reverse conversion. The pgmtosbig command allows users to specify the desired output dimensions for the SBig image using various options, which can be useful for adapting the image to a target display resolution. It's part of the extensive Netpbm suite, which provides a versatile toolkit for manipulating various image formats, emphasizing simplicity and pipeline compatibility.

CAVEATS

The "SBig" format is a niche, binary format primarily designed for specific hardware or display systems, not widely used for general image storage or web display.

It expects PGM input. Using other image formats will likely result in an error or corrupted output.

Dimensions specified via options may scale or crop the image, potentially altering its aspect ratio or content.

HISTORY

pgmtosbig is part of the Netpbm project, an open-source graphics toolkit that evolved from Jef Poskanzer's PBMplus package, originally released in 1988. The Netpbm suite provides a foundational set of tools for converting and manipulating various graphics formats, often using common "portable" formats like PGM as intermediaries. This command, like many in Netpbm, reflects an older era of image processing where specialized binary formats were more common for direct display on specific hardware.

SEE ALSO

sbigtopgm(1), pgm(5), netpbm(1)

Copied to clipboard