LinuxCommandLibrary

sbigtopgm

Convert Sun rasterfile to portable graymap

TLDR

Convert an SBIG CCDOPS image file to PGM

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

SYNOPSIS

sbigtopgm [ -b|--bias bias_file ] [ -d|--dark dark_file ] [ -f|--flat flat_file ] [ -v|--verbose ] [ -g|--gamma gamma_value ] [ -i|--input-offset offset_value ] [ -o|--output-gain gain_value ] [ -p|--precision ] [ -s|--scale ] [ -c|--crop x,y,width,height ] [ input_file ]

When input_file is not specified, sbigtopgm reads from standard input. Output is always to standard output.

PARAMETERS

-b, --bias bias_file
    Subtracts the specified bias frame from the image. The bias_file must be in SBIG format.

-d, --dark dark_file
    Subtracts the specified dark frame from the image. The dark_file must be in SBIG format.

-f, --flat flat_file
    Divides the image by the specified flat field frame. The flat_file must be in SBIG format.

-v, --verbose
    Prints detailed information about the input file and the processing steps to standard error.

-g, --gamma gamma_value
    Applies gamma correction to the image. A gamma_value greater than 1 brightens shadows, less than 1 darkens them.

-i, --input-offset offset_value
    Adds a constant offset to all pixel values before any other processing (e.g., calibration frames).

-o, --output-gain gain_value
    Multiplies all pixel values by a gain factor after processing, affecting the overall brightness.

-p, --precision
    Preserves the original pixel depth of the SBIG file. The output PGM will use the exact maximum value from the input, without scaling to the PGM maxval (65535 for 16-bit).

-s, --scale
    Scales the output pixel values to the full PGM intensity range (e.g., 0-65535 for 16-bit). This is the default behavior if -p is not used, ensuring the PGM file uses its full dynamic range.

-c, --crop x,y,width,height
    Crops the image to the specified rectangular region, where x and y are the top-left coordinates, and width and height define the size of the crop.

DESCRIPTION

sbigtopgm is a utility from the Netpbm package designed to convert raw image files produced by SBIG (Santa Barbara Instrument Group) astronomical cameras into the standard Portable Graymap (PGM) format. This is crucial for astronomers and astrophotographers who use SBIG CCD cameras, as it allows them to process and view their captured images using a wide range of image processing tools that support the PGM format.

The command supports various image calibration techniques essential for astronomical imaging, including dark frame subtraction, flat field correction, and bias frame subtraction, to remove noise and correct for sensor imperfections. It also offers options for scaling, gamma correction, and cropping, enabling users to prepare images for further analysis or visual presentation.

CAVEATS

  • SBIG File Format Specificity: sbigtopgm is designed for the specific raw image format produced by Santa Barbara Instrument Group (SBIG) cameras and may not work with other camera raw formats.
  • Monochrome Output: The command produces Portable Graymap (PGM) files, which are inherently monochrome. While SBIG cameras can sometimes capture color data (e.g., with Bayer filters), sbigtopgm primarily processes the raw grayscale intensity data.
  • Calibration Frame Requirement: For effective noise reduction and image correction using dark, bias, and flat frames, these calibration frames must also be in the SBIG format.

USAGE IN ASTROPHOTOGRAPHY

This tool is fundamental for astrophotographers using SBIG cameras. It allows them to convert proprietary raw files into a standard format, making it possible to apply advanced astronomical image processing techniques (e.g., stacking, deconvolution) using other software that commonly supports PGM or can convert from PGM.

STANDARD INPUT/OUTPUT

Like many Unix-philosophy tools, sbigtopgm can read from standard input if no input file is specified, and always writes its output to standard output. This facilitates piping it with other commands, for example: cat image.sbig | sbigtopgm -v | pgmtopng > image.png.

HISTORY

sbigtopgm is a component of the Netpbm project, a suite of graphics utilities for converting, processing, and creating various image formats. Its inclusion reflects the need within the astronomical community to process specialized raw image data from SBIG CCD cameras into a more universally accessible format. It has been developed and maintained as part of the broader Netpbm toolkit, ensuring compatibility and integration with other image manipulation functionalities offered by the suite.

SEE ALSO

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

Copied to clipboard