Astrophysics Source Code Library

Making codes discoverable since 1999

ASCL Code Record

[ascl:1010.002] fpack: FITS Image Compression Program

fpack is a utility program for optimally compressing images in the FITS data format. The associated funpack program will restore the compressed file back to its original state. These programs may be run from the host operating system command line and are analogous to the gzip and gunzip utility programs, except that they are specifically optimized for FITS format images and offer a wider choice of compression options.

fpack uses the tiled image compression convention for storing the compressed images. This convention can in principle support any number of of different compression algorithms; currently GZIP, Rice, Hcompress, and the IRAF pixel list compression algorithms have been implemented.

The main advantages of fpack compared to the commonly used technique of externally compressing the whole FITS file with gzip are:

  1. It is generally faster and offers better compression than gzip.
  2. The FITS header keywords remain uncompressed for fast access.
  3. Each HDU of a multi-extension FITS file is compressed separately, so it is not necessary to uncompress the entire file to read a single image in a multi-extension file.
  4. Dividing the image into tiles before compression enables faster access to small subsections of the image.
  5. The compressed image is itself a valid FITS file and can be manipulated by other general FITS utility software.
  6. Lossy compression can be used for much higher compression in cases where it is not necessary to exactly preserve the original image.
  7. The CHECKSUM keywords are automatically updated to help verify the integrity of the files.
  8. Software that supports the tiled image compression technique can directly read and write the FITS images in their compressed form.

Code site:
Described in:
Keywords: NASA

Views: 1869

Add this shield to your page
Copy the above HTML to add this shield to your code's website.