0% found this document useful (0 votes)
44 views5 pages

Hierarchical Prediction and Context Adaptive Coding For Lossless Color Image Compression

Uploaded by

Rinkal Singh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
44 views5 pages

Hierarchical Prediction and Context Adaptive Coding For Lossless Color Image Compression

Uploaded by

Rinkal Singh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

IEEE TRANSACTIONS ON IMAGE PROCESSING, VOL. 23, NO.

1, JANUARY 2014 445

Hierarchical Prediction and Context Adaptive


Coding for Lossless Color Image Compression
Seyun Kim, Student Member, IEEE, and Nam Ik Cho, Senior Member, IEEE

Abstract— This paper presents a new lossless color image be Lossless JPEG [1], JPEG-LS [2], LOCO-I [3], CALIC [4],
compression algorithm, based on the hierarchical prediction and JPEG2000 [5] (lossless mode) and JPEG XR [6]. The
context-adaptive arithmetic coding. For the lossless compression LOCO-I and CALIC were developed in the process of JPEG
of an RGB image, it is first decorrelated by a reversible color
transform and then Y component is encoded by a conventional standardization, where most ideas in LOCO-I are accepted for
lossless grayscale image compression method. For encoding the the JPEG-LS standard although the CALIC provides better
chrominance images, we develop a hierarchical scheme that compression performance at the cost of more computations.
enables the use of upper, left, and lower pixels for the pixel For the compression of color images, the color components
prediction, whereas the conventional raster scan prediction meth- are first decorrelated by a color transform, and each of the
ods use upper and left pixels. An appropriate context model for
the prediction error is also defined and the arithmetic coding is transformed components is independently compressed by the
applied to the error signal corresponding to each context. For above referenced methods. For example, the RGB to Y Cb Cr
several sets of images, it is shown that the proposed method transform [7] may be the most frequently used one for the
further reduces the bit rates compared with JPEG2000 and lossy compression of color image and video. However, in the
JPEG-XR. case of lossless compression, most color transforms cannot be
Index Terms— Lossless color image compression, reversible used due to their uninvertibility with integer arithmetic. Hence
color transform, hierarchical prediction, context adaptive an invertible version of color transform, the reversible color
arithmetic coding. transform (RCT) was defined and used in JPEG2000 [5]. There
have also been much research for finding better RCTs [8]–[10],
I. I NTRODUCTION among which we adopt a transform proposed in [9] because
it approximates the conventional Y Cb Cr transform very well.
D IGITAL images are usually encoded by lossy compres-
sion methods due to their large memory or bandwidth
requirements. The lossy compression methods achieve high
The purpose of this paper is to develop a hierarchical
prediction scheme, while most of existing prediction methods
compression ratio at the cost of image quality degradation. in lossless compression are based on the raster scan prediction
However, there are many cases where the loss of information which is sometimes inefficient in the high frequency region.
or artifacts due to compression needs to be avoided, such as The “hierarchical” prediction for the compression was already
medical, prepress, scientific and artistic images. As cameras proposed in [11], but only pixel interpolation is used here. In
and display systems are going high quality and as the cost of this paper, we design an edge directed predictor and context
memory is lowered, we may also wish to keep our precious and adaptive model for this hierarchical scheme. To be specific,
artistic photos free from compression artifacts. Hence efficient we propose a method that can use lower row pixels as well
lossless compression will become more and more important, as the upper and left pixels for the prediction of a pixel to
although the lossy compressed images are usually satisfactory be encoded. For the compression of color images, the RGB is
in many cases. first transformed to Y Cu Cv by an RCT mentioned above [9],
Along with the standardization or independently, many and Y channel is encoded by a conventional grayscale image
lossless image compression algorithms have been proposed. compression algorithm. In the case of chrominance channels
Among a variety of algorithms, the most widely used ones may (Cu and Cv ), the signal variation is generally much smaller
than that of RGB, but still large near the edges. For more
Manuscript received September 11, 2013; revised November 18, 2013; accurate prediction of these signals, and also for accurate
accepted November 21, 2013. Date of publication December 3, 2013; date
of current version December 12, 2013. This work was supported in part by modeling of prediction errors, we use the hierarchical scheme:
Samsung Electronics and in part by the Ministry of Science, ICT and Future the chrominance image is decomposed into two subimages; i.e.
Planning, Korea, through the Information Technology Research Center support a set of even numbered rows and a set of odd numbered rows
Program supervised by the National IT Industry Promotion Agency under
Grant NIPA-2013-0301-13-4005. The associate editor coordinating the review respectively. Once the even row subimage X e is encoded, we
of this manuscript and approving it for publication was Dr. Ali Bilgin. can use all the pixels in X e for the prediction of a pixel in
S. Kim is with Samsung Electronics, Yongin 151-744, Korea (e-mail: the odd row subimage X o . In addition, since the statistical
[email protected]).
N. I. Cho is with the Department of Electrical and Computer Engi- properties of two subimages are not much different, the pdf
neering, INMC, Seoul National University, Seoul 446-711, Korea (e-mail: of prediction errors of a subimage can be accurately mod-
[email protected]). eled from the other one, which contributes to better context
Color versions of one or more of the figures in this paper are available
online at http://ieeexplore.ieee.org. modeling for arithmetic coding. Experiments on various kinds
Digital Object Identifier 10.1109/TIP.2013.2293428 of images are performed, and it is shown that the proposed
1057-7149 © 2013 IEEE
446 IEEE TRANSACTIONS ON IMAGE PROCESSING, VOL. 23, NO. 1, JANUARY 2014

Algorithm 1 Calculation of dir (i, j ) Algorithm 2 Calculation of xˆo (i, j )

the predictors are defined as (1) because upper and lower


pixels are used for the “vertical” whereas just a left pixel is
Fig. 1. Input image and its decomposition.
used for the “horizontal.” The horizontal predictor is more
accurate only when there is a strong horizontal edge. For
example, the frequency of selecting horizontal predictor is just
method provides higher coding gain than JPEG2000 and 0.03% ∼ 1.45% for the images in Kodak set [13] which is one
JPEG-XR in many cases. of the image sets used in the experiments. Hence, the vertical
predictor is used for most pixels, and mode selection is used
II. H IERARCHICAL D ECOMPOSITION only when the pixel seems to be on a strong horizontal edge.
AND P IXEL P REDICTION For implementing this idea, we define a variable for the
The chrominance channels Cu and Cv resulting from the direction of edge at each pixel dir (i, j ), which is given either
RCT usually have different statistics from Y , and also different H or V . Actually, it is given H only when the horizontal
from the original color planes R, G, and B. In the chrominance edge is strong, and given V for the rest. Deciding dir (i, j )
channels, the overall signal variation is suppressed by the is summarized in Algorithm 1, where it can be seen that the
color transform, but the variation is still large near the object direction is given H only when |x o (i, j ) − x̂ h (i, j )| is much
boundaries. Hence, the prediction errors in a chrominance smaller than |x o (i, j ) − xˆv (i, j )| by adding a constant T1 to
channel are much reduced in a smooth region, but remain the former when comparing them.
relatively large near the edge or within a texture region. Based on the directions of pixels, the overall prediction
For the efficient lossless compression, it is important to scheme is summarized in Algorithm 2. It can be seen that the
accurately estimate the pdf of prediction error for better mode selection is tried when more than one of dir (i −1, j ) or
context modeling, along with the accurate prediction. For this, dir (i, j − 1) are H , and the vertical prediction is performed
we propose a hierarchical decomposition scheme as depicted for the rest.
in Fig. 1, which shows that pixels in an input image X is
III. P ROPOSED C ODING S CHEME
separated into two subimages: an even subimage X e and an
odd subimage X o . Then, X e is encoded first and is used In this section, we explain the overall process of image
to predict the pixels in X o . In addition, X e is also used to compression, including the new encoding scheme. An input
estimate the statistics of prediction errors of X o . In actual RGB color image is transformed into Y Cu Cv color space
implementation, X e is decomposed once more as will be by an RCT. The luminance image Y is encoded by any of
explained later. lossless grayscale image coders, such as CALIC, JPEG-LS,
For the compression of X o pixels using X e , directional or JPEG2000 lossless. The chrominance images Cu and Cv
prediction is employed to avoid large prediction errors near the are encoded using the method described in Section II. To be
edges. For each pixel x o (i, j ) in X o , the horizontal predictor specific, a chrominance image X (0) ∈ {Cu , Cv } is decomposed
(1)
xˆh (i, j ) and vertical predictor xˆv (i, j ) are defined as row by row into an even subimage X e and an odd subimage
(1) (1)
X o as shown in Fig. 2. The subimage X o is predicted and
xˆh (i, j ) = x o (i, j − 1) (1)
  encoded using X e , as described in Section II. The subimage
x e (i, j ) + x e (i + 1, j ) (1)
xˆv (i, j ) = r ound , (1) X e can be further decomposed column by column into the
(2) (2)
2 even subimage X e and the odd subimage X o as shown
and one of them is selected as a predictor for x o (i, j ). With in the last figure of Fig. 2, where the subimage X o(2) is
these two possible predictors, the most common approach compressed using X e(2) .
to encoding is “mode selection,” where better predictor for In the predictive lossless compression, efficient encoding
each pixel is selected and the mode (horizontal or vertical) of the prediction error e(i, j ) = x o (i, j ) − xˆo (i, j ) plays
is also transmitted as side information. However, the vertical an important role. Although the proposed prediction method
predictor is more often correct than the horizontal one when usually generates small prediction errors owing to the RCT and
KIM AND CHO: HIERARCHICAL PREDICTION AND CONTEXT ADAPTIVE CODING 447

TABLE II
C OMPRESSED B IT R ATES (bpp) FOR THE M EDICAL I MAGES

Fig. 2. Illustration of hierarchical decomposition.

TABLE I
AVERAGE OF C OMPRESSED B IT R ATES (bpp) FOR 24 K ODAK I MAGES

TABLE III
C OMPRESSED B IT R ATES (bpp) FOR THE C OMMERCIAL
D IGITAL C AMERA I MAGES

Fig. 3. An example of context and pdf of error depending on the context.


(a) Input image. (b) Context. (c) Conditional pdf. IV. E XPERIMENTAL R ESULTS
As stated in the introduction, the state-of-the-art lossless
the sophisticated prediction scheme, there are still relatively compression method may be the CALIC [4], which shows
large errors near the edge or texture region, which degrades higher coding gain than the JPEG-LS (or LOCO-I) [2], [3]
the compression performance. For the efficient compression, at the cost of higher computational complexity. For the com-
the statistics of symbols (prediction errors) should well be pression of color image, the JPEG2000 and JPEG-XR [6]
described by an appropriate model and/or parameters. We lossless provide better coding gain than the independent
model the prediction error as a random variable with pdf encoding of each channel by CALIC and also than the encod-
P(e|Cn ), where Cn is the coding context that reflects the ing by CALIC after RCT. Hence we compare the proposed
magnitude of edges and textures. Specifically, Cn is the level method with JPEG2000 and JPEG-XR. The excutables for our
of quantization steps of pixel activity σ (i, j ) defined as encoder/decoder and all the images used in the experiments
are publicly available at our website [18].
σ (i, j ) = |x e (i, j ) − x e (i + 1, j )|. (2) We first apply the algorithm on Kodak image set [13], which
is widely used for the test of lossless compression [14]–[16]
Note that the local activity and its quantization steps are and demosaicking [17]. In all the experiments, the parameter
calculated with the pixels in X e , because all the pixels of T1 in Algorithm 2 and number of contexts K are set to 3 and 6
X e are available and its statistical property would be almost respectively. The luminance images and decomposed highest
the same as that of X o . The local activity is quantized into K level images X e(2) in Fig. 2 are encoded by JPEG2000 lossless.
steps such that Cn represents the step Experiments are summarized in Table I, which shows that the
proposed method performs better than the compared methods.
qn−1 ≤ σ (i, j ) < qn (3) It should also be noted that different color transforms are
used in each of the methods stated above. Hence, for fair
for n = 1, . . . , K with q0 = 0 and q K = ∞. The length of comparison, we also perform experiments with the same RCT
quantization steps is determined such that each step includes defined in [9], the results of which are denoted as “JPEG2000
the same number of elements (local activities). For each with RCT [9]” and “JPEG-XR with RCT [9]” in Table I. It
context, a generic adaptive arithmetic coder [12] is used to can be seen that the recent RCT improves the coding gain
encode the prediction error. For illustration, Fig. 3 shows an though not significant. On the average, the proposed algorithm
input image, the local activity of a subimage (context), and improves 7.10% and 18.89% over JPEG2000 and JPEG-XR
P(e|Cn ) for several Cn . It describes the statistical property of respectively.
prediction error very well, in that the error magnitude is large The proposed method is also tested on medical images in
when the local activity is strong. Hence the proposed model Fig. 4 and compared with JPEG2000 and JPEG-XR in Table II.
can be effective for the compression with arithmetic coding. The test medical images are positron emission tomography
448 IEEE TRANSACTIONS ON IMAGE PROCESSING, VOL. 23, NO. 1, JANUARY 2014

TABLE V
C OMPARISON OF CPU T IMES (S ECONDS ) ON A PC W ITH I NTEL
C ORE - I 5 2.67 GH Z CPU

V. C ONCLUSION
We have proposed a lossless color image compression
Fig. 4. The medical images. method based on a hierarchical prediction scheme and context-
adaptive arithmetic coding. For the compression of an RGB
image, it is first transformed into Y Cu Cv color space using an
RCT. After the color transformation, the luminance channel Y
is compressed by a conventional lossless image coder. Pixels
in chrominance channels are predicted by the hierarchical
decomposition and directional prediction. Finally, an appropri-
ate context modeling of prediction residuals is introduced and
arithmetic coding is applied. The proposed method and several
Fig. 5. The digital camera images.
conventional methods have been tested on the Kodak image
TABLE IV
set, some medical images, and digital camera images, and it is
C OMPRESSED B IT R ATES (bpp) FOR C LASSIC I MAGES
shown that average bit rate reductions over JPEG2000 for these
sets are shown to be 7.10%, 13.55%, and 5.52% respectively.

R EFERENCES
[1] W. B. Pennebaker and J. L. Mitchell, JPEG Still Image Data Compres-
sion Standard. New York, NY, USA: Van Nostrand Reinhold, 1993.
[2] Information Technology—Lossless and Near-Lossless Compression of
Continuous-Tone Still Images (JPEG-LS), ISO/IEC Standard 14495-1,
1999.
[3] M. Weinberger, G. Seroussi, and G. Sapiro, “The LOCO-I lossless image
compression algorithm: Principles and standardization into JPEG-LS,”
(PET) images for human brain, digital camera images for eyes IEEE Trans. Image Process., vol. 9, no. 8, pp. 1309–1324, Aug. 2000.
and eyeground, and endoscope images for human intestine, [4] X. Wu and N. Memon, “Context-based, adaptive, lossless image coding,”
which are generally smooth and hence less bits are generated IEEE Trans. Commun., vol. 45, no. 4, pp. 437–444, Apr. 1997.
[5] Information Technology—JPEG 2000 Image Coding System—Part 1:
when compared with the case of Kodak images. On the Core Coding System, INCITS/ISO/IEC Standard 15444-1, 2000.
average, the proposed algorithm produced 13.55% less bits [6] ITU-T and ISO/IEC, JPEG XR Image Coding System—Part 2: Image
than JPEG2000 lossless. In addition, experiments for images Coding Specification, ISO/IEC Standard 29199-2, 2011.
[7] G. Sullivan, “Approximate theoretical analysis of RGB to YCbCr to
from commercial digital cameras (shown in Fig. 5) are also RGB conversion error,” ISO/IEC JTC1/SC29/WG11 and ITU-T SG16
conducted, and the results are compared in Table III. The first Q.6 document JVT-I017, 2003.
five images are captured with NIKON D90, and the rest are [8] H. S. Malvar, G. J. Sullivan, and S. Srinivasan, “Lifting-based reversible
color transformations for image compression,” Proc. SPIE, vol. 707307,
captured with OLYMPUS E-P1. On the average, the proposed pp. 707307-1–707307-10, Aug. 2008.
algorithm produces 5.52% less bits than JPEG2000 lossless. [9] S. Pei and J. Ding, “Improved reversible integer-to-integer color trans-
It is also noted that the proposed method does not always forms,” in Proc. 16th IEEE ICIP, Nov. 2009, pp. 473–476.
[10] T. Strutz, “Adaptive selection of colour transformations for reversible
perform best for every set of images. The proposed hierarchi- image compression,” in Proc. 20th Eur. IEEE Signal Process. Conf.,
cal encoding scheme sometimes works better and sometimes Aug. 2012, pp. 1204–1208.
worse than the conventional methods, depending on image sets [11] P. Roos, M. A. Viergever, M. C. A. van Dijke, and J. H. Peters,
“Reversible intraframe compression of medical images,” IEEE Trans.
and also depending on the channels (Y , Cu , and Cv ). It is also Med. Imag., vol. 7, no. 4, pp. 328–336, Dec. 1988.
true for every compression algorithms, i.e. the coding gain [12] A. Said, “Arithmetic coding,” in Lossless Compression Handbook,
of compression algorithms differ on different set of images. K. Sayood, Ed. San Diego, CA, USA: Academic, 2003.
[13] (1991). Images from KODAK Photo CD Photo Sampler
For example, on the set of classical test images such as Lena, [Online]. Available: http://www.site.uottawa.ca/~edubois/demosaicking
Peppers, and Mandrill, even the channel independent CALIC [14] Z. Mai, P. Nasiopoulos, and R. Ward, “A wavelet-based intra-prediction
sometimes performs better than JPEG2000 and our algorithm, lossless image compression scheme,” in Proc. Int. Conf. Consum.
Electron., Jan. 2009, pp. 1–2.
as shown in Table IV. [15] H. S. Malvar and G. J. Sullivan, “Progressive-to-lossless compression
Finally, the CPU times taken by the above stated methods of color-filter-array images using macropixel spectral-spatial transforma-
are measured for 24 Kodak images, and their averages are tion,” in Proc. DCC, Apr. 2012, pp. 3–12.
[16] N. Zhang and X. Wu, “Lossless compression of color mosaic images,”
summarized in Table V. It shows that the JPEG2000 spends IEEE Trans. Image Process., vol. 15, no. 6, pp. 1379–1388, Jun. 2006.
CPU time about 2 times more than JPEG-XR. Since our [17] B. K. Gunturk, Y. Altunbasak, and R. M. Mersereau, “Color plane
method employs JPEG2000 and needs additional steps for interpolation using alternating projections,” IEEE Trans. Image Process.,
vol. 11, no. 9, pp. 997–1013, Sep. 2002.
hierarchical prediction and context modeling, it needs slightly [18] (Dec. 3, 2013) [Online]. Available: http://ispl.snu.ac.kr/light4u/project/
more computation time than the JPEG2000. LCIC
KIM AND CHO: HIERARCHICAL PREDICTION AND CONTEXT ADAPTIVE CODING 449

Seyun Kim received the B.S. and Ph.D. degrees Nam Ik Cho received the B.S., M.S., and Ph.D.
from Seoul National University, Seoul, Korea, in degrees in control and instrumentation engineering
2002 and 2013, respectively. He is currently a Senior from Seoul National University, Seoul, Korea, in
Engineer with Samsung Electronics, Yongin, Korea. 1986, 1988, and 1992, respectively. From 1991 to
His research interests include image processing, 1993, he was a Research Associate with the Engi-
image compression, and computer vision. neering Research Center for Advanced Control and
Instrumentation, Seoul National University. From
1994 to 1998, he was with the University of Seoul,
Seoul, as an Assistant Professor of electrical engi-
neering. He joined the Department of Electrical and
Computer Engineering, Seoul National University, in
1999, where he is currently a Professor. His research interests include image
processing, adaptive filtering, and computer vision.

You might also like