[fitsbits] Re: FITS vs. TIFF (or other image formats)

Rob Seaman seaman at noao.edu
Tue Nov 20 15:16:06 EST 2001


Paul Schlyter inquires:

> Really?  You're sure it's not Base64 encoded?

Yes - unless I missed that bullet on Bill Pence's overhead at the ADASS BOF :-)

FITS "classic" images have an ASCII (7 bit minus control characters)
header with the pixel array following in suitably cartesian fashion.
The pixels are usually signed 16 bit integers or 32 bit IEEE floating
point numbers.  There are some other choices, including 8 bit unsigned
integers.  There may be some special purpose applications that use the
8 bit pixels - but not many.  There are no options for ASCII pixel
representations.

FITS files can also contain tabular data populated with similar datatypes.
These tables can be in an ASCII format, but the newer binary format is
likely more prevalent these days.  One could imagine encoding an image
(as opposed to a spectra) as an ASCII table.  This would be seriously
inefficient, but maybe somebody has a example of why one would do such
a thing.

The biggest difference between large astronomical images and small JPEGs
and such that one encounters online is that we care about preserving the
dynamic range of the pixels as well as the characteristics of the
background noise.  Noise doesn't compress very well, so neither do
scientifically useful images.  Astronomical applications that require
high compression are usually custom tailored to the particular needs
of the data set in question.

Of course, astronomers often do distribute public outreach style images
in compressed formats such as TIFF, GIF or JPEG.  Try to vary the contrast
or brightness of such an image and you'll discover where all the bytes
went.

Rob Seaman
National Optical Astronomy Observatory



More information about the fitsbits mailing list