SPIHT IMAGE COMPRESSION


Frequently Asked Questions

Below we present the most commonly asked questions about the SPIHT programs. Questions about the method and image compression in general are answered in the technical discussion page.

Compiling and running the compression programs.
Implementation details of the programs.
Coding algorithm.

If you also have a question, or are not satisfied with an answer, send an e-mail to one address listed in the home page.

Compression Programs: Compiling and Running

Q. I tried to compile the programs in codetree.tar with a DOS/Windows compiler, but it doesn't work. Do you have a DOS/Windows version?

A. Actually, the programs were written and tested in a PC! So, no special version is needed. We have 6 programs using the same files, and what is missing is the #define directives to inform the compiler what program to make (this is presently done in the make (.mk) and script files).

In a DOS/Windows compiler you need to add the words shown below in the DEFINE menu of the compilers. The project files are codetree.c, general.c, image_bw.c plus the file shown below.

        Program   -      Define        -  Project file

        codetree  -  ENCODER           -  aritcode.c
        decdtree  -  DECODER           -  aritcode.c
        fastcode  -  ENCODER;BINCODE   -  bincode.c
        fastdecd  -  DECODER;BINCODE   -  bincode.c
        progcode  -  ENCODER;LOSSLESS  -  aritcode.c
        progdecd  -  DECODER;LOSSLESS  -  aritcode.c
  

Q. What is the meaning of the error message below?

  Error: < Image_BW > dimension is too small or negative
  

A. Consider the following practical problems

  • Adaptive methods need time to adapt.
  • The wavelet transform may not be efficient at the borders.
  • The hierarchical trees must have something more than only roots and leaves.
  • Odd-sized images may need extension.
  • Image compression methods are good to exploit the similarity of pixels in large areas.

Those problems are irrelevant when the images are large enough, and so we may not have used in our programs the best method to deal with them. To avoid unfair comparisons we just made the programs refuse to code very small images (the minimum size depends on the program version). See below more about the same subject

Q. Why the decoder has to ask the rate? Couldn't it just stop at the end of the file?
A. Yes, it surely could, and in fact it can be easily modified to do just that. However, recall that these are demonstrative programs. They are ready to show what is embedded coding, and how it can simplify getting points for PSNR vs. rate graphs.

Compression Programs: Code Details

Q. How does the "smoothing factor" affects the image?

A. The smoothing factor changes the scaling of the wavelet (subband) transform coefficients. This way there is a larger number of highpass coefficients set to zero, leaving more bits to represent the lowpass components. The name "smoothing" is used because the process does that, and is somewhat equivalent to a nonlinear lowpass filtering.

Note that it is not similar to the linear lowpass filtering used by other programs for entropy reduction.

Q. What method is used for color compression?
A. Presently the demo program calculates the correlation between colors and then applies the KL transform to the color components. The wavelet transform is then applied to the three resulting images, and the hierarchical trees of three color images are put together in the SPIHT lists. Then we just run the SPIHT algorithm and see it minimize the combined MSE of the color images.

Coding Algorithm

Q. I divided the images in many small square blocks. Can I use SPIHT to compress them? (After all, JPEG codes 8x8 blocks)
A. Yeah, JPEG can surely do it, but it can't do progressive transmission! (Please, don't get into the subject of progressive JPEG...) By the way, if you're planning to try it, the programs will not compress the small images... The SPIHT coding method can be used when (like JPEG) you specify the quality instead of the file size. However, the demo programs would need substantial changes to be used for that purpose.
Q. Why some images compress well in the GIF format and with universal compression programs like gzip, and others don't? When should I use SPIHT?

A. Try this link to get the basic rules (at the end) and see below why you should follow them.

Some compression methods exploit the equality of pixels values and others exploit their similarity. It sounds like the same thing, but the difference in practice can be enormous.

Graphical images or cartoons, which have pixels in large areas with exactly the same value, compress well with general-purpose methods (like the Lempel-Ziv). On the other hand, for natural images the adjacent pixels tend to have similar, but rarely equal gray or color values. Some shading variations are hard to see, until you remove them using gross quantization, and producing really awful images. The general purpose methods fail miserably to detect similarity, and have little use for natural images.

Thus, you must use methods like SPIHT to compress natural images. They work well in a really wide range of pictures, in fact wider than we can define. (What is the resemblance between pictures of a wedding party and of Mount Fuji and a chest X-ray?)

Links to other pages.

SPIHT Home Page;
Properties of the Method
Licensing Information
Demo Programs
Papers
Demo Images
Technical Discussion
WWW Image Compression Resources
Guest Book

These pages are still under construction. Sorry for any inconvenience...