# man > fitstopnm(1)

> **TLDR:** Convert a Flexible Image Transport System (FITS) file to a PNM image.
>
- Convert a FITS file to a PNM image:
  `fitstopnm {{path/to/file.fits}} > {{path/to/output.pnm}}`
- Convert the image on the specified position of the third axis in the FITS file:
  `fitstopnm {{-i|-image}} {{z_position}} {{path/to/file.fits}} > {{path/to/output.pnm}}`

*Source: tldr-pages*

---

[fitstopnm(1)](https://www.chedong.com/phpMan.php/man/fitstopnm/1/markdown)                           General Commands Manual                          [fitstopnm(1)](https://www.chedong.com/phpMan.php/man/fitstopnm/1/markdown)



## NAME
       fitstopnm - convert a FITS file into a portable anymap

## SYNOPSIS
       **fitstopnm** [**-image** _N_] [**-noraw**] [**-scanmax**] [**-printmax**] [**-min** _f_] [**-max** _f_] [_FITSfile_]

## DESCRIPTION
       Reads  a FITS file as input.  Produces a portable pixmap if the FITS file consists of 3 image
       planes (NAXIS = 3 and NAXIS3 = 3), a portable graymap 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.**

## OPTIONS
       The **-image** option is for FITS files with three axes.  The assumption is that the  third  axis
       is for multiple images, and this option lets you select which one you want.

       Flags  **-min**  and  **-max**  can  be used to override the min and max values as read from the FITS
       header or the image data if no DATAMIN and DATAMAX keywords are found.  Flag **-scanmax** can  be
       used  to  force  the  program to scan the data even when DATAMIN and DATAMAX are found in the
       header. If **-printmax** is specified, the program will just print the min  and  max  values  and
       quit.  Flag **-noraw** can be used to force the program to produce an ASCII portable anymap.

       The  program will tell what kind of anymap is writing.  All flags can be abbreviated to their
       shortest unique prefix.

## REFERENCES
       FITS stands for Flexible Image Transport System.  A full description can be found in  Astron‐
       omy & Astrophysics Supplement Series 44 (1981), page 363.

## SEE ALSO
       [pnmtofits(1)](https://www.chedong.com/phpMan.php/man/pnmtofits/1/markdown), [pgm(5)](https://www.chedong.com/phpMan.php/man/pgm/5/markdown), [pnmflip(1)](https://www.chedong.com/phpMan.php/man/pnmflip/1/markdown)

## AUTHOR
       Copyright  (C)  1989 by Jef Poskanzer, with modifications by Daniel Briggs (<dbriggs@nrao.edu>)
       and Alberto Accomazzi (<alberto@cfa.harvard.edu>).



                                           20 September 89                              [fitstopnm(1)](https://www.chedong.com/phpMan.php/man/fitstopnm/1/markdown)
