Databases Reference
In-Depth Information
I
1
(
i
,
j
) =
I
(
i
1
,
j
)
(1)
I
2
(
i
,
j
) =
I
(
i
,
j
1
)
(2)
I
(
,
) =
(
,
)
(3)
3
i
j
I
i
1
j
1
I
(
,
) =
(
,
) +
(
,
)
(
,
)
(4)
4
i
j
I
i
j
1
I
i
1
j
I
i
1
j
1
I
5
(
i
,
j
) =
I
(
i
,
j
1
) + (
I
(
i
1
,
j
)
I
(
i
1
,
j
1
)) /
2
(5)
I
6
(
i
,
j
) =
I
(
i
1
,
j
) + (
I
(
i
,
j
1
)
I
(
i
1
,
j
1
)) /
2
(6)
I
7
(
i
,
j
) = (
I
(
i
,
j
1
) +
I
(
i
1
,
j
)) /
2
(7)
Different images can have different structures that can best be exploited by one of these
eight modes of prediction. If compression is performed in a non-real-time environment—for
example, for the purposes of archiving—all eight modes of prediction can be tried, and the
one that gives the most compression is used. The mode used to perform the prediction can
be stored in a 3-bit header along with the compressed file. We encoded our four test images
using the various JPEG modes. The residual images were encoded using adaptive arithmetic
coding. The results are shown in Table 7.1 .
The best results—that is, the smallest compressed file sizes—are indicated in bold in the
table. From these results, we can see that a different JPEG predictor is the best for the different
images. In Table 7.2 , we compare the best JPEG results with the file sizes obtained using GIF
and PNG. Note that PNG also uses predictive coding with four possible predictors, where each
row of the image can be encoded using a different predictor. The PNG approach is described
in Chapter 5.
From this comparison, even if we take into account the overhead associated with GIF, we
can see that the predictive approaches are generally better suited to lossless image compression
than the dictionary-based approach when the images are “natural” grayscale images. The
situation is different when the images are graphic images or pseudocolor images. A possible
exception could be the Earth image. The best compressed file size using the second JPEG
mode and adaptive arithmetic coding is 32,137 bytes, compared to 34,276 bytes using GIF.
The difference between the file sizes is not significant. We can see the reason by looking at
the Earth image. Note that a significant portion of the image is the background, which is of
a constant value. In dictionary coding, this would result in some very long entries that would
provide significant compression. We can see that if the ratio of background to foreground were
just a little different in this image, the dictionary method in GIF might have outperformed the
JPEG approach. The PNG approach which allows the use of a different predictor (or no
predictor) on each row, prior to dictionary coding, significantly outperforms both GIF and
JPEG on this image.
T A B L E 7 . 1
Compressed file size (in bytes) of the residual images obtained
using the various JPEG prediction modes.
Image
JPEG 0
JPEG 1
JPEG 2
JPEG 3
JPEG 4
JPEG 5
JPEG 6
JPEG 7
Sena
53,431
37,220
31,559
38,261
31,055
29,742
33,063
32,179
Sensin
58,306
41,298
37,126
43,445
32,429
33,463
35,965
36,428
Earth
38,248
32,295
32,137
34,089
33,570
33,057
33,072
32,672
Omaha
56,061
48,818
51,283
53,909
53,771
53,520
52,542
52,189
 
Search WWH ::




Custom Search