Linux Commands Examples

A great documentation place for Linux commands


convert a portable anymap into FITS format

see also : fitstopnm


pnmtofits [-max f] [-min f] [pnmfile]

add an example, a script, a trick and tips

: email address (won't be displayed)
: name

Step 2

Thanks for this example ! - It will be moderated and published shortly.

Feel free to post other examples
Oops ! There is a tiny cockup. A damn 404 cockup. Please contact the loosy team who maintains and develops this wonderful site by clicking in the mighty feedback button on the side of the page. Say what happened. Thanks!


no example yet ...

... Feel free to add your own example above to help other Linux-lovers !


Reads a portable anymap as input. Produces a FITS (Flexible Image Transport System) file as output. The resolution of the output file is either 8 bits/pixel, or 16 bits/pixel, depending on the value of maxval in the input file. If the input file is a portable bitmap or a portable graymap, the output file consists of a single plane image (NAXIS = 2). If instead the input file is a portable pixmap, the output file will consist of a three-plane image (NAXIS = 3, NAXIS3 = 3). A full description of the FITS format can be found in Astronomy & Astrophysics Supplement Series 44 (1981), page 363.


Flags -min and -max can be used to set DATAMAX, DATAMIN, BSCALE and BZERO in the FITS header, but do not cause the data to be rescaled.


FITS uses signed data, and this program outputs unsigned values. If you run into this problem, you might use "-min 32768".

see also

fitstopnm , pgm


Copyright (C) 1989 by Wilson H. Bent (, with modifications by Alberto Accomazzi (alberto[:at:]cfa.harvard[:dot:]edu).

How can this site be more helpful to YOU ?

give  feedback