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 [spotfile]

DESCRIPTION

spottopgm is a specialized utility from the Netpbm toolkit, designed to convert SPOT satellite image files into the Portable Graymap (PGM) format. It reads a SPOT image file from either a specified file path or standard input, and then outputs the resulting PGM image to standard output. This allows for seamless piping with other Netpbm tools or general image processing applications.

SPOT files are a specific format for satellite imagery, as detailed in the "SPOT Data User's Handbook" by CNES. The command supports two types of SPOT data files: raw data (volume 1) and processed data (volume 2). For raw data files, it requires a specific header that typically resides on a tape block boundary before the image data, which often needs to be extracted using tools like dd. This utility is crucial for integrating SPOT satellite imagery into workflows that leverage the Netpbm suite for further manipulation or format conversion.

CAVEATS

spottopgm requires specific SPOT file formats. For raw SPOT data (volume 1), a header block must precede the image data. This header is typically found on a tape block boundary and may need to be extracted using tools like dd before being passed to spottopgm. The command's functionality is dependent on the SPOT file adhering to the specifications outlined in the "SPOT Data User's Handbook" by CNES.

INPUT/OUTPUT

spottopgm reads input from the file specified as an argument or, if no argument is provided, from standard input. It always writes the resulting PGM image to standard output. This design facilitates piping operations, allowing the output to be directly consumed by other Netpbm utilities or command-line tools for further processing, conversion, or display.

HISTORY

spottopgm is part of the Netpbm project, a comprehensive suite of graphics programs created by Jef Poskanzer in the late 1980s as the Pbmplus package. Netpbm tools are known for their "Unix philosophy" design, focusing on small, single-purpose utilities that can be chained together. spottopgm was developed to provide interoperability for SPOT satellite imagery, which became increasingly relevant for geographical and environmental analysis. Its inclusion reflects Netpbm's ongoing mission to support a wide array of image formats, even specialized ones like SPOT, allowing users to process and integrate this data within standard Unix-like environments.

SEE ALSO

pgm(5), netpbm(1), anytopnm(1), dd(1)

Copied to clipboard