Hcompress Image Compression Software




Hcompress is the image compression package written by Richard L. White for use at the Space Telescope Science Institute. Hcompress was used to compress the STScI Digitized Sky Survey and has also been used to compress the preview images in the Hubble Data Archive. Briefly, the method used is:

The technique gives very good compression for astronomical images and is fast, requiring about 1 second for compression or decompression of a 512x512 image on a Sun SPARCstation 2. (Yes, this software was written a long time ago.) The calculations are carried out using integer arithmetic and are entirely reversible. Consequently, the program can be used for either lossy or lossless compression, with no special approach needed for the lossless case (e.g. there is no need for a file of residuals.) Documentation on the use of the programs and on the compression method is included in the doc subdirectory.

These programs can compress 2-byte integer images in a small variety of input formats (including FITS format, the most widely used format for astronomical images.) The resulting compressed image file is machine-independent and may be transferred between computers with binary FTP. The source code is reasonably machine-independent, although it has not been tested on a wide range of machines. Installation instructions for Unix machines are given in the README file and below.

Software Version

This is version 1.2 of the program, released 2018 February 7. This is the first version that uses the Gnu configure build system. Functionally the software is almost identical to the previous (1994!) release, but one bug that affected the decompression of images with pixel values near the bounds of the 16-bit integer range (-32768 or 32767) has been fixed. Note that the compressed images are not affected by this bug, so data compressed with the preceding version has no problems.

Other changes of note: The software has been recoded to ANSI C standards and the interfaces have been changed to make it easily embedded in other applications (in which case the compressed data are written and read from an in-memory buffer rather than a file).

Installation Instructions

The README file in the package describes the installation instructions. For a standard build do this:

Known Bugs

I know of no bugs in this version but welcome reports of any.


Copyright (c) 1994 Association of Universities for Research in Astronomy. All rights reserved. Produced under National Aeronautics and Space Administration Contract No. NAS5-26555.
STScI Home Page | Software
Richard L. White, rlw@stsci.edu
2019 December 5