JPEG compression carries with it a very high price in terms of the image
contents. The goal of all compression techniques is to preserve those details and
characteristics of the original image that are noticed by human vision and which
convey information to the viewer necessary for the recognition of familiar objects.
The original JPEG technique reduces the amount of color information, applies a
discrete cosine transform to 8
×
8 pixel blocks in the image, rounds off the resulting
coefficients to a set of quantized values (and eliminates small terms, particularly for
color data) and then encodes the result. The technique has been widely used because
the algorithm can be embedded into chips as well as carried out in software, and it
is quite fast.
The JPEG method, however, discards information from the image and, in addi-
tion to the appearance of visually distracting blockiness, alters colors, reduces color
resolution, shifts edges, removes real texture and inserts artificial texture (lossy
compression). All of these problems are minor if the purpose is to allow recognition
of pictures of the kids in the backyard, or a reminder of a visit to the Eiffel tower,
but for scientific imaging it creates serious problems. First, we are usually not trying
to simply recognize familiar structures, but to detect or characterize unfamiliar
things. Second, we may want to measure those structures, and alterations in position,
dimension, shape and color are not acceptable.
There are other compression methods available as well. Wavelet compression,
which is part of the newer JPEG2000 standard, uses a wavelet transform instead of
the discrete cosine method. The results do not show the visible blockiness that the
original JPEG method produces (because of its use of 8
×
8 pixel blocks), but it has
the unfortunate characteristic of discarding more detail in some parts of the image
(where there was a lot of original detail present) while keeping it elsewhere. Fractal
compression, on the other hand, inserts artificial detail into the image everywhere.
This prevents enlargements from appearing to be interpolated (empty magnification),
but the detail is not real, just pixel patterns borrowed from elsewhere in the image.
Real details are replaced by visually plausible borrowings. Fractal compression is
very asymmetric, meaning that it takes much longer to perform the compression
than to decompress the stored image.
One of the best ways to see what lossy compression discards from an image is
to perform the compression on an original image and then subtract the result from
the original. As shown in Figure 2.9, the differences reveal the changes in pixel
brightness (and also color), displacement of edges, alteration of texture, and so forth.
Detecting whether an image has ever been subjected to lossy compression can usually
be done by looking just at the color information. A discussion of the various color
spaces to which images can be converted is presented below. In HSI space the hue
channel, or in L-a-b space the a and b channels, reveal the loss of resolution by their
blurry or blocky appearance as shown in Figure 2.10.
The safest recommendation for scientific imaging is to avoid any lossy com-
pression entirely. Most high-end cameras, and all scanning microscopes with digital
output, provide lossless image formats. There may still be a small amount of com-
pression possible, by finding repetitive sequences of values in different parts of the
image and representing them with an abbreviated code. The LZW (Lempel–Ziv–Welch)
2241_C02.fm Page 68 Thursday, April 28, 2005 10:23 AM
Copyright © 2005 CRC Press LLC