fitstopnm - convert a FITS file into a portable anymap
| Use Case | Command | Description |
|---|---|---|
| Convert FITS image to PPM (color) | fitstopnm image.fits | Converts a 3-plane FITS file to a PPM image |
| Convert FITS image to PGM (grayscale) | fitstopnm image.fits | For 2-plane FITS files, outputs a PGM |
| Select a specific image plane | fitstopnm -image 2 image.fits | Extracts the 2nd image from a multi-image FITS |
| Force ASCII output (slow) | fitstopnm -noraw image.fits | Produces ASCII (text) PPM/PGM instead of raw binary |
| Override data range | fitstopnm -min 0 -max 255 image.fits | Manually set pixel value scaling |
| Print min/max values | fitstopnm -printmax image.fits | Display the data min and max and exit |
| Force scanning for min/max | fitstopnm -scanmax image.fits | Ignore header DATAMIN/DATAMAX and scan the actual data |
fitstopnm [ -image N ] [ -noraw ] [ -scanmax ] [ -printmax ] [ -min f ] [ -max f ] [ FITSfile ]
Reads a FITS file as input. Produces a portable pixmap (PPM) if the FITS file consists of 3 image planes (NAXIS = 3 and NAXIS3 = 3), a portable graymap (PGM) if the FITS file consists of 2 image planes (NAXIS = 2), or whenever the -image flag is specified. The results may need to be flipped top for bottom; if so, just pipe the output through pnmflip -tb.
The program will tell what kind of anymap is writing. All flags can be abbreviated to their shortest unique prefix.
FITS stands for Flexible Image Transport System. A full description can be found in Astronomy & Astrophysics Supplement Series 44 (1981), page 363.
Copyright (C) 1989 by Jef Poskanzer, with modifications by Daniel Briggs (dbriggs AT nrao.edu) and Alberto Accomazzi (alberto AT cfa.edu).
20 September 89
Generated by phpman v4.10.0-7-g98e9fd5 · Markdown · JSON · MCP Author: Che Dong Under GNU General Public License
2026-09-04 14:21 @216.73.216.128
CrawledBy Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)