IEEE SIGNAL PROCESSING LETTERS, VOL. 9, NO. 1, JANUARY 2002
5
An Online Preprocessing Technique for Improving the Lossless Compression of Images With Sparse Histograms Armando J. Pinho
Abstract—This letter addresses the problem of improving the efficiency of lossless compression of images with sparse histograms. An online preprocessing technique is proposed, which, although very simple, is able to provide significant improvements in the compression ratio of the images that it targets and shows a good robustness on other images. Index Terms—Images with sparse histograms, lossless image compression, preprocessing technique.
I. INTRODUCTION
J
PEG-LS [1] and JPEG-2000 [2] are the most recent ISO/ITU standards for compressing continuous-tone images. The main aim of JPEG-LS is to provide efficient lossless compression at a reasonable complexity, although means for near-lossless compression (a special case of lossy compression where the maximum absolute error is directly controlled) are also included in the standard. On the other hand, JPEG-2000 was designed with the main objective of providing efficient lossy compression for a wide range of compression ratios [2], [3]. JPEG-LS [1], [4] is based on the LOCO-I algorithm (low complexity lossless compression for images) [5], which was chosen to incorporate the standard due mainly to its good balance between complexity and compression efficiency. Another technique that was also proposed and evaluated during the JPEG-LS standardization process was context-based, adaptive, lossless image codec (CALIC) [6], an algorithm that has been considered state-of-the-art in terms of compression performance. Nevertheless, the compression gains of CALIC in relation to LOCO-I were not considered sufficient in order to justify the required increase in algorithmic complexity. In addition to an improved rate-distortion characteristic, most notably for low bit-rates, JPEG-2000 offers a large number of features, in comparison to the well-known and widely used JPEG standard [3], [7]. Moreover, and of special interest to the work presented in this letter, the reversible discrete wavelet transform that JPEG-2000 uses for lossless compression
Manuscript received April 25, 2001; revised November 19, 2001. This work was supported in part by the Fundação para a Ciência e a Tecnologia (FCT). The associate editor coordinating the review of this manuscript and approving it for publication was Prof. G. Scarano. The author is with the Department de Electrónica e Telecomunicações, Instituto de Engenharia Electrónica e Telemática de Aveiro (IEETA), 3810–193 Aveiro, Portugal (e-mail:
[email protected]). Publisher Item Identifier S 1070-9908(02)02412-4.
provides a considerable improvement over the prediction based lossless mode of JPEG [8], [9]. II. THE PROBLEM JPEG-LS and JPEG-2000 were both designed mainly with the aim of compressing continuous-tone natural images. However, the amount of images that nowadays falls outside this class is large and continuously increasing. Effectively, besides natural content, numerous images of interest may include other types of content, such as graphical and textual. Frequently, this kind of images do not use the complete set of available intensities (of colors or tones of gray), i.e., the histogram of intensities is sparse. The impact of histogram sparseness on the performance of JPEG-2000 and JPEG-LS (as well as on other image compression techniques that are based on similar principles) can be observed in Tables I and II, where compression ratios obtained before offline histogram packing (“normal” column) and after offline histogram packing (“offline packing” column) are presented. offline histogram packing was performed by mapping the intensity values of each image into a contiguous set, maintaining the original order. As can be seen, the compression improvement after offline histogram packing is very significant for images having sparse histograms, i.e., the images in the first group and some of the images in the third group1 (the number of different intensities composing each image is displayed in the “Intensities” column). For images not belonging to this class, such as those in the second group, a slight decrease in compression ratio may be verified, which is due to the small overhead introduced by the mapping table required for later recovery of the original intensity values. The problem concerning the efficient compression of images having sparse histograms (also referred to as “simple” images) is addressed in [10], where an embedded image-domain adaptive compression technique (EIDAC) is proposed with the aim of efficiently compressing “simple” images. EIDAC is based on a context-adaptive bit-plane coder, where each bit-plane is encoded by a binary arithmetic encoder. The coder performs a “bit-plane reduction,” which has similar objectives as the offline histogram packing procedure, although using a more complex approach. The piecewise-constant image mode (PWC) coder [11], although specifically designed for compressing palette images, can also be used for compressing “simple” (gray-level) images 1More
details concerning these images are given in Section IV.
1070–9908/02$17.00 © 2002 IEEE
6
IEEE SIGNAL PROCESSING LETTERS, VOL. 9, NO. 1, JANUARY 2002
TABLE I COMPARISON OF THE COMPRESSION RESULTS (IN BITS/SAMPLE) OBTAINED WITH JPEG-2000 APPLIED DIRECTLY TO THE IMAGES (“NORMAL”), WITH JPEG-2000 APPLIED TO THE OFF-LINE HISTOGRAM-PACKED IMAGES (“OFF-LINE PACKING”) AND WITH JPEG-2000 APPLIED TO THE ON-LINE HISTOGRAM PACKING METHOD PROPOSED IN THIS LETTER (“ON-LINE PACKING”)
TABLE II COMPARISON OF THE COMPRESSION RESULTS (IN BITS/SAMPLE) OBTAINED WITH JPEG-LS APPLIED DIRECTLY TO THE IMAGES (“NORMAL”), WITH JPEG-LS APPLIED TO THE OFF-LINE HISTOGRAM-PACKED IMAGES (“OFF-LINE PACKING”) AND WITH JPEG-LS APPLIED TO THE ON-LINE HISTOGRAM PACKING METHOD PROPOSED IN THIS LETTER (“ON-LINE PACKING”)
[10]. On the other hand, JPEG-LS [4] provides a “sample-mapping procedure,” allowing the decoder to map each decoded sample value into a reconstructed sample value. This feature, although mainly planned for handling palette images, can also be used for storing histogram mapping tables. However, if histogram packing is required, it has to be performed offline, a
problem that will be addressed in Part 2 of JPEG-LS, through the inclusion of means for online packing [12]. In fact, offline packing implies a priori knowledge of the sparseness of the histogram or, if this knowledge is not available, it requires a two-pass operation, which may not be possible or desirable in some applications.
PINHO: ONLINE PREPROCESSING TECHNIQUE IMPROVING LOSSLESS COMPRESSION
In the remainder of this letter we describe an online preprocessing technique for histogram packing. This method operates completely detached from the encoders, which means that it does not require any modification of the encoding algorithms. Moreover, it is very simple to implement. III. THE PREPROCESSING TECHNIQUE Let us assume that the preprocessor is going to handle sample and that it has already found different intensity values, . In other words, for . Let us also assume, without loss of generality, . Then, the intensity mapping, , that is used that is to map sample (1) which maps ascending sorted intensity values into ascending sorted contiguous indexes. , then symbol is generated by the preIf processor (and passed to the encoder). On the other hand, if , then the symbol that is generated by the preprocessor is , i.e., the next free index. In this case, the new intensity value, , is recorded2 (in order to allow reversing the preprocessing procedure, typically during decoding). The occurrence of a new intensity also implies the rearrangement of the mapping, such , then the new mapping, , should be that, if (2) As can be seen, is inserted in the mapping table such that the ascending sorted property is maintained. In practice, this implies that all intensities greater than see their mapping index increased by one unit. The packing is reversed using a similar approach. If the symbol to be reverse-mapped corresponds to some index in use, then normal mapping is performed. If not, then an intensity value is read from the list of intensities (the one that was created during the packing phase) and the mapping table is rearranged accordingly. IV. EXPERIMENTAL RESULTS AND CONCLUSIONS To assess the efficiency of the proposed preprocessing technique we used three sets of images. Two of them3 were those used by Yoo et al. to test the efficiency of EIDAC [10]. The first set (corresponding to the first group of images in Tables I and II) is a gray-scale-converted version of a set used by Ausbeck in its PWC coder [11].4 The second set (second group in Tables I and II) comprises several natural images and has the objective of testing the robustness of the method in images that are not “simple” (this set was also used in [10]). The third set (last group of images in Tables I and II) is composed of five im2For simplicity, we record these intensity values directly, which means that, for 8 bpp images, each new intensity value is stored in one byte and that, in the worst case, we have to store 256 values. The compression results that we present in the next section include this overhead. 3From http://sipi.usc.edu/~younggap/EIDAC. 4We considered only images with at least four intensities, due to a restriction in the JPEG-LS coder that we used (SPMG/JPEG-LS V.2.2 codec, ftp://spmg.ece.ubc.ca/pub/jpeg-ls/ver-2.2/).
7
ages taken from the BragZone archive.5 This set was recently used to illustrate the poor performance of JPEG-LS and CALIC in compressing this type of images [12]. Table I presents the results obtained with the lossless mode of JPEG-2000.6 As can be observed, only two images (“goldhill” and “lena”) were negatively affected by the packing procedure. However, globally, the result is clearly positive. Moreover, the online packing procedure proposed in this letter provides globally better results than offline packing. This behavior is due to the fact that, for some images, such as “cmpndd,” “cmpndn” and “sea_dusk,” most of the preprocessing is performed with only a small number intensities in use, which further improves the compression ratio. The results obtained for JPEG-LS (displayed in Table II) are also clearly positive. Moreover, the online preprocessing approach was also globally better than offline packing for the second and third group of images. Although not included in this letter, results showing similar improvements were obtained with CALIC. Based on these results, we conclude that the online preprocessing technique presented in this letter, albeit quite simple, is also very effective, sometimes even better than its offline counterpart. Moreover, being a preprocessing approach, it does not imply any modification of the particular compression technique to which we want to associate it. This characteristic is of particular importance when the use of standards or well-established general-purpose compression techniques is required or desirable. REFERENCES [1] Information technology—Lossless and near-lossless compression of continuous-tone still images, ISO/IEC 14 495–1 and ITU Rec. T.87, 1999. [2] Information technology—JPEG 2000 image coding system, ISO/IEC FCD15444–1 and ITU-T Rec. T.800, 2000. [3] M. W. Marcellin, M. J. Gormish, A. Bilgin, and M. P. Boliek, “An overview of JPEG-2000,” in Proc. DCC-2000, Snowbird, UT, Mar. 2000, pp. 523–541. [4] M. J. Weinberger, G. Seroussi, and G. Sapiro, “The LOCO-I lossless image compression algorithm: Principles and standardization into JPEG-LS,” IEEE Trans. Image Processing, vol. 9, pp. 1309–1324, Aug. 2000. , “LOCO-I: A low complexity, context-based, lossless image com[5] pression algorithm,” in Proc. DCC-96, Snowbird, UT, Mar. 1996, pp. 140–149. [6] X. Wu and N. Memon, “Context-based, adaptive, lossless image coding,” IEEE Trans. Commun., vol. 45, pp. 437–444, Apr. 1997. [7] M. Boliek, J. S. Houchin, and G. Wu, “JPEG 2000 next generation image compression system features and syntax,” in Proc. 7th IEEE ICIP-2000, Vancouver, BC, Canada, Sept. 2000, pp. 45–48. [8] D. Santa-Cruz, T. Ebrahimi, J. Askelöf, M. Larsson, and C. A. Christopoulos, “JPEG 2000 still image coding versus other standards,” Applications of Digital Image Processing XXIII — Proc. SPIE, Aug. 2000. [9] D. Santa-Cruz and T. Ebrahimi, “An analytical study of JPEG 2000 funcionalities,” in Proc. 7th IEEE ICIP-2000, Vancouver, BC, Canada, Sept. 2000, pp. 49–52. [10] Y. Yoo, Y. G. Kwon, and A. Ortega, “Embedded image-domain compression using context models,” in Proc. 6th IEEE ICIP-99, Kobe, Japan, Oct. 1999, pp. 477–481. [11] P. J. Ausbeck, Jr., “The piecewice-constant image model,” Proc. IEEE, vol. 88, pp. 1779–1789, Nov. 2000. [12] B. Carpentieri, M. J. Weinberger, and G. Seroussi, “Lossless compression of continuous-tone images,” Proc. IEEE, vol. 88, pp. 1797–1809, Nov. 2000. 5From 6Using
http://links.uwaterloo.ca/BragZone. the JPEG-2000 V.3.2.2 codec, http://jj2000.epfl.ch/.