LinuxCommandLibrary

spottopgm

Convert SPOT image files to PGM image format

TLDR

Convert the specified SPOT image to PGM format

$ spottopgm [path/to/file.spot] > [path/to/output.pgm]
copy

Extract the specified color channel
$ spottopgm -[1|2|3] [path/to/file.spot] > [path/to/output.pgm]
copy

Extract the specified rectangle from the input image
$ spottopgm [first_col first_row last_col last_row] [path/to/file.spot] > [path/to/output.pgm]
copy

SYNOPSIS

spottopgm [rasterfile]

PARAMETERS

rasterfile
    The Sun rasterfile to convert. If not specified, spottopgm reads from standard input.

DESCRIPTION

The spottopgm command converts a Sun rasterfile (also known as a Sun window dump file) into a Portable Graymap (PGM) image format.

Sun rasterfiles are an older image format, commonly used on Sun Microsystems workstations. PGM is a simpler, more widely supported format that is easily processed by other image manipulation tools. spottopgm enables you to bridge the gap between these formats, allowing you to view and edit legacy Sun rasterfiles using modern image software.

The program reads the Sun rasterfile from standard input and writes the resulting PGM image to standard output. It automatically handles different types of Sun rasterfiles, including those with colormaps and those with different pixel depths. The output PGM image is a grayscale representation of the original rasterfile, even if the input was a color image. Color images are converted to grayscale.

The program does not use temporary files.

USAGE

To convert a Sun rasterfile named 'image.ras' to a PGM file named 'image.pgm', use the following command: spottopgm image.ras > image.pgm

SEE ALSO

pgmtosun(1), ppmtopgm(1), rasttopnm(1)

Copied to clipboard