LOSSLESS COMPRESSION OF CFA-SAMPLED IMAGES USINGYDGCOCG TRANSFORMS WITH CDF WAVELETSTaizo Suzuki
Faculty of Engineering, Information and Systems, University of Tsukuba, Japan
Email: taizo@cs.tsukuba.ac.jp
ABSTRACTThis paper discusses reversible color transforms, in which a raw
camera image captured using a color filter array (CFA) is from red,green, and blue (RGB) color space to YDgCoCg color space for lossless compression. We found that conventional reversible color transforms (YDgCoCg transforms) are composed of three Haar wavelets,
which are simple type of wavelet. Since the finding means that theYDgCoCg transforms on the basis of other wavelets that can moreaccurately predict pixels of interest in the predict steps have the potential to generate more sparse signals, we replaced Haar wavelets inthe YDgCoCg transforms with Cohen-Daubechies-Feauveau (CDF)
5/3 and 9/7 wavelets, which were customized on the basis of the original pixel positions in two-dimensional (2D) space. The experimental results show that the extended YDgCoCg (YDgCoCg-X) transforms, which achieve higher sparsity, outperformed the conventionaltransforms when they are applied to the color transform parts in theJPEG 2000 and JPEG extended range (XR) lossless modes.

Fig. 1. Bayer pattern of a particular area of Parrot in Kodak images [11] (each 2 × 2 pixel is a macropixel): (left) full color imageand (right) simulated CFA-sampled image with corresponding diagram.

Color transforms, which change a full color image from red, green,
and blue (RGB) color space to a color space expressed by one luma
and two chroma components, are commonly used in image (video)
preprocessing. Since more information is included in the luma component than in the chroma components, i.e., the color-transformed
image is composed of sparse signals, the color transforms contribute
greatly to the implementation of effective image processing, especially regarding image compression. Traditional compression standards, such as JPEG [1], JPEG 2000 [2], and MPEG-2 [3], employ
the color transforms and their reversible transforms from RGB toYCbCr color space (YCbCr transforms), in which Y, Cb, and Cr are
the luma, the blue-difference chroma, and the red-difference chroma
components, respectively. Newer compression standards, such as
JPEG extended range (XR) [4], advanced video coding (AVC) [5],and high efficiency video coding (HEVC) [6] employ the reversible
color transforms from RGB to YCoCg color space (YCoCg transforms), in which Y, Co, and Cg are the luma, the orange chroma,and the green chroma components, respectively. The YCoCg transforms, which are composed of only two simple mean and difference
calculations between each color component, produce more sparse
signals than the YCbCr transforms.
Raw camera images captured using a color filter array (CFA),
such as a Bayer pattern (shown in Fig. 1) (CFA-sampled images),

are usually compressed after they are demosaiced. However, we canalso choose to compress CFA-sampled images before demosaicing
them because many professional photographers and designers prefer to work with them directly [7–10]. In [7], Zhang et al. discussed lossless compression of CFA-sampled images using wavelets.
In [9], Lee et al. further reduced the redundancies between thechroma components generated in [7]. In [8], Malvar et al. proposed low-complexity reversible color transforms, which change aCFA-sampled image from RGB to YDgCoCg color space (YDgCoCg transforms1 ) for lossless compression of CFA-sampled images. The YDgCoCg transforms are obtained by adding a different
green component (Dg) to the YCoCg transforms, and they compriseof only three simple mean and difference calculations between eachcolor component. In [10], Hernández-Cabronero et al. presenteda lossless compression pipeline of CFA-sampled images, that thecompressed images can be directly displayed using any JPEG 2000
standard-compliant viewer without need for additional development
software, but this paper does not consider such visualization.
This paper discusses the YDgCoCg transforms for lossless compression of CFA-sampled images. We found that conventional YDgCoCg transforms are composed of three Haar wavelets, which area simple type of wavelet. Since the finding means that the YDgCoCg transforms on the basis of other wavelets that can more accurately predict pixels of interest in the predict steps have the potential
to generate more sparse signals, we replaced Haar wavelets in theYDgCoCg transforms with Cohen-Daubechies-Feauveau (CDF) 5/3
and 9/7 wavelets, which were customized on the basis of the original
pixel positions in two-dimensional (2D) space. The experimental results show that the extended YDgCoCg (YDgCoCg-X) transforms,
which achieve higher sparsity, outperform the conventional transforms when they are applied to the color transform parts in the JPEG
2000 and JPEG XR lossless modes.

This work was supported by JSPS Grant-in-Aid for Young Scientists (B),
Grant Number 16K18100.

1 In [8], they are called macropixel spectral-spatial transformations(MSSTs) because they are implemented on each 2 × 2 macropixel.

Index Terms— Color filter array, lossless compression, reversible color transforms, wavelets, YDgCoCg color space.
1. INTRODUCTION

978-1-4799-7061-2/18/$31.00 ©2018 IEEE1143

ICIP 2018Table 1. Coefficients of CDF 5/3 and 9/7 wavelets.
CDF 5/3
CDF 9/7
p0−1/2−1.586134342
u0
1/4−0.05298011854
p100.8829110762
u100.4435068522
s11.149604398

Notation: Boldface letters represent matrices. I, J, O, and superscript ⊤ indicate the 2 × 2 identity matrix, the 2 × 2 reversal
matrix, the 2 × 2 zero matrix, and the transpose of a matrix/vector,respectively.
2. REVIEW AND DEFINITION
2.1. Cohen-Daubechies-Feauveau Wavelets
CDF wavelets are common transforms used for image processing.
For practical image processing, the wavelets W(z) often consist oflifting schemes with predict and update steps as [12][W(z) =s00−1s] ∏[010k=N −1 |][Uk (z)11Pk (z){z}|{zupdate step]
0,1}

(1)

predict step

where s is a nonzero scaling coefficient, z is a delay, and Pk (z) andUk (z) are lifting coefficients with arbitrary coefficients pk and uk as
Pk (z) = (1 + z −1 )pkand

Uk (z) = (1 + z)uk ,respectively. Furthermore, the diagonal matrix with a scaling coefficient s can be factorized into lifting schemes, such as[] [][][][]
s0
10 1 s−1 1 0
1 s − s2.
−1 =−111 10
10 s−s1 0(2)
Reversibility is achieved by applying a rounding operator to eachlifting step that does not have a coefficient of ±i (i ∈ N); for example, the coefficients s, pk , and uk in CDF 5/3 (N = 1) and 9/7(N = 2) wavelets, as shown in Table 1. Because the CDF 5/3 and9/7 wavelets can more accurately predict pixels of interest in the predict steps than the Haar wavelets, they generate more sparse signals.

Fig. 2. Reversible color transforms (white circles represent rounding
operators): (top-to-bottom) YCoCg, YDgCoCg, represented YDgCoCg, and YDgCoCg-X transforms.

Reversibility is achieved by applying a rounding operator to eachlifting step that does not have a coefficient of ±i.
To apply the YCoCg transforms to a CFA-sampled image, they
were extended as (see the second image down in Fig. 2) [8][Y, Dg, Co, Cg

2.2. YCoCg and YDgCoCg Transforms
The YCoCg transforms change a full color image from RGB toYCoCg color space with low-complexity calculations as (see top image in Fig. 2) [4][Y, Co, Cg]⊤[]⊤= T G, R, B ,(3)





1 0
10 00 0 11 0  0 1
T = 0 1 0   00 0
1/2 0 1
1 0 0

1 00
10010 0 1 −1 .
· 00 010 1/2 1

−10 1

0
0
T =
01
0
1
000(4)

1144[]⊤= T G1 , G2 , R, B ,(5)

where

1
0·0where

]⊤

001
01/2
100

1 0 0
10 0 011 0 0  0 1 00  0

00 1 000 0 10 0 0
1/2 0 0 10
10 00000 00 −1 1 0.
0 1 −1
10  01/2 100 01

−10
0
1(6)

The sets of R, G1 , G2 , and B are in macropixels, as shown in Fig. 1.
Reversibility is achieved by applying a rounding operator to eachlifting step that does not have a coefficient of ±i. The YDgCoCg
transforms T are implemented as shown at the top of Fig. 3.

Fig. 3. Implementations: (top) the YDgCoCg transforms and (bottom) the YDgCoCg-X transforms.

3. YDGCOCG-X TRANSFORMSTheorem: When W(z1 , z2 ) is 2D wavelets that are customized asfollows:[][]
0∏
1 Uk (z1 , z2 )10
W(z1 , z2 ) =, (7)01
Pk (z1 , z2 ) 1
k=N −1 |{z}|{z}update step

predict step

where z1 and z2 are the delays horizontally and vertically, andPk (z1 , z2 ) and Uk (z1 , z2 ) are lifting coefficients as
1(1 + z1−1 + z2−1 + z1−1 z2−1 )pk2
1
Uk (z1 , z2 ) = (1 + z1 + z2 + z1 z2 )uk ,2Pk (z1 , z2 ) =the YDgCoCg-X transforms T as (see the fourth image down inFig. 2) are expressed by:[]⊤[]⊤Y, Dg, Co, Cg = T G1 , G2 , R, B ,(8)where
10T =00|
0
1·00|0001{z 2s00 0

1 000}0100P100
10{z10000100



00

s−10


0 [0 W(z1−1 , z2 )0O1}

0 [−10  W(z2 )0 Os−1]O.
W(z1−1 , z2−1 )JFig. 4. Test images: (top) Akademie, Arri, Church, and Color
Test Chart, (middle) Face, Lake Locked, Lake Pan, and Night atOdeonplatz, (bottom) Swimming Pool, Sharpness Chart, and Nightat Siegestor.

By using three Haar wavelets, we can represent the YDgCoCg transforms in (6) as (see the third image down in Fig. 2)[T = P1]
O
I

(9)

HO]
[OH
P0IO]
O.
HJ(11)

To improve the transform performance, we can also use otherwavelets W(z), such as CDF 5/3 and 9/7 wavelets, which canmore accurately predict pixels of interest in the predict steps, insteadof the Haar wavelets in the YDgCoCg transforms as[W(z)Tb = P1O][OW(z)P0IO]
O.
W(z)J(12)P0

Reversibility is achieved by applying a rounding operator to eachlifting step that does not have a coefficient of ±i. Note that the delay
patterns in (9) are for a Bayer pattern, as shown in Fig. 1, and they
depend on the original CFA pattern. The YDgCoCg-X transforms T
are implemented as shown at the bottom of Fig. 3.
Proof: Haar wavelets are simple type of wavelet regarding thepredict and update steps:[] [][]
1/2 1/2
1 1/2
10
H==.
(10)
−1
10
1−1 1
| {z } | {z }update step

predict step

1145

Moreover, by replacing one-dimensional (1D) wavelets W(z) withthe 2D wavelets W(z1−1 , z2 ), W(z1−1 , z2−1 ), and W(z2−1 ), in order to take into account the original pixel positions in 2D space,and by then merging the scaling coefficients for simplicity, we obtain the YDgCoCg-X transforms T in (9). Because the predict andupdate steps of the YDgCoCg-X transforms are implemented withmore pixels around pixels of interest than those in the Haar wavelets,
which are predicted and updated with only an adjacent pixel, thecompression performance is expected to be better. Furthermore,when the YDgCoCg-X transforms T in (9) are composed of three
Haar wavelets, they are equivalent to the YDgCoCg transforms T in(6) and the corresponding ones in (11).

Fig. 5. Subband images of Color Test Chart transformed by YDgCoCg-X transforms: (top) subband images (clockwise from top-left: Y ,Dg, Cg, and Co), (bottom) expanded display of the Dg components, and (left-to-right) Haar, CDF 5/3, and CDF 9/7 wavelets.
Table 2. Lossless image compression results using JPEG 2000 and JPEG XR lossless modes (lossless bitrate [bpp]).
JPEG 2000
JPEG XR
[8]
[9]
[9]
Prop.
Prop.
[8]
[9]
[9]
Prop.
Prop.
Haar CDF 5/3 CDF 9/7 CDF 5/3 CDF 9/7 Haar CDF 5/3 CDF 9/7 CDF 5/3 CDF 9/7
Akademie
11.84
11.63
11.65
11.60
11.51
11.82
11.59
11.61
11.58
11.50
Arri
11.13
10.85
10.90
10.87
10.78
11.22
10.91
10.96
10.96
10.88
Church
10.64
10.34
10.38
10.38
10.31
10.73
10.40
10.44
10.46
10.39
Color Test Chart
9.82
9.94
9.98
9.73
9.71
9.84
9.94
9.97
9.76
9.74
9.63
9.61
9.60
9.54
9.50
9.65
9.64
9.62
9.57
9.52
Face
Lake Locked
10.74
10.60
10.64
10.56
10.51
10.72
10.57
10.62
10.55
10.51
Lake Pan
12.18
11.92
11.97
11.91
11.83
12.24
11.94
11.99
11.95
11.88
Night at Odeonplatz 10.51
10.54
10.57
10.41
10.39
10.49
10.52
10.54
10.40
10.37
Swimming Pool
11.29
11.14
11.16
11.13
11.07
11.32
11.15
11.17
11.15
11.10
9.19
9.14
9.16
9.14
9.11
10.05
9.89
9.87
9.96
9.88
Sharpness Chart
Night at Siegestor
10.48
10.49
10.51
10.37
10.35
10.45
10.45
10.47
10.34
10.33
Average
10.68
10.56
10.59
10.51
10.46
10.78
10.64
10.66
10.61
10.55

4. EXPERIMENTAL RESULTS
We compared the YDgCoCg-X transforms that used CDF 5/3 and9/7 wavelets with the conventional transforms in [8]2 and [9]3 regarding lossless bitrate [bpp] with the existing codecs, JPEG 2000
and JPEG XR, using MATLAB and Photoshop. We employed acommonly-used symmetric extension [13] at the image boundaries.
As with the test images, we used 2880 × 1620 RGB full color images with a 16-bit dynamic range in each color component [14]. To
simulate CFA-sampled images, we subsampled the test images in accordance with the Bayer pattern in Fig. 1 and reduced their dynamic
range from 16 to 14-bits because the actual sensor data only had 14bit resolution at most. Additionally, since the YDgCoCg color space
has both positive and negative values, we separated the signs fromthe images and added them to the decoded images later. The extra 1
bit was reflected in the following results.
Figure 5 shows the subband images of the Color Test Chart
2 The YDgCoCg transforms in [8] are equivalent with the YDgCoCg-X
transforms based on Haar wavelets as previously mentioned.
3 Although [7] and [9] employed “wavelet packets,” we set 1 as thewavelet level to evaluate the performance simply and fairly. Naturally, theYDgCoCg-X transforms can also use wavelet packets.

1146

transformed by the YDgCoCg-X transforms. The YDgCoCg-X
transforms that used CDF 5/3 and 9/7 wavelets reduced the redundancies between each color component compared with the YDgCoCg transforms that used Haar wavelets. Thus, the YDgCoCg-X
transforms that used CDF 5/3 and 9/7 wavelets outperformed theconventional transforms when they were applied to the color transform parts in the JPEG 2000 and JPEG XR lossless modes, as shownin Table 2.
5. CONCLUSION
This paper discussed the YDgCoCg-X transforms for lossless compression of CFA-sampled images. They were obtained by replacing Haar wavelets in the YDgCoCg transforms with CDF 5/3 and9/7 wavelets that were customized on the basis of the original pixel
positions in 2D space. The experimental results showed that theproposed YDgCoCg-X transforms, which achieve higher sparsity,
outperformed the conventional transforms when they were applied
the color transform parts in the JPEG 2000 and JPEG XR losslessmodes. Because of the high sparsity, the proposed transforms areexpected to also be applied to other types of CFA-sampled image
processing.

6. REFERENCES[1] G. K. Wallace, “The JPEG still picture compression standard,”
IEEE Trans. Consum. Electr., vol. 38, no. 1, pp. xviii–xxxiv,Feb. 1992.
[2] A. Skodras, C. Christopoulis, and T. Ebrahimi,“TheJPEG2000 still image compression standard,” IEEE Signal
Process. Mag., vol. 18, no. 5, pp. 36–58, Sep. 2001.
[3] J. L. Mitchell, W. B. Pennebaker, C. Fogg, and D. J. LeGall,
MPEG Video Compression Standard, Dordrecht, The Netherlands: Kluwer Academic, 2000.
[4] F. Dufaux, G. J. Sullivan, and T. Ebrahimi, “The JPEG XRimage coding standard,” IEEE Signal Process. Mag., vol. 26,no. 6, pp. 195–199, 204, Nov. 2009.
[5] T. Wiegand, G. J. Sullivan, G. Bjøntegaard, and A. Luthra,“Overview of the H.264/AVC video coding standard,” IEEE
Trans. Circuits Syst. Video Technol., vol. 13, no. 7, pp. 560–576, July 2003.
[6] G. J. Sullivan, J.-R. Ohm, W.-J. Han, and T. Wiegand,“Overview of the high efficiency video coding (HEVC) standard,” IEEE Trans. Circuits Syst. Video Technol., vol. 22, no.
12, pp. 1649–1668, Dec. 2012.
[7] N. Zhang and X. Wu, “Lossless compression of color mosaicimages,” IEEE Trans. Image Process., vol. 15, no. 6, pp. 1379–1388, June 2006.
[8] H. S. Malvar and G. J. Sullivan, “Progressive-to-lossless compression of color-filter-array images using macropixel spectralspatial transformation,” in Proc. of DCC’12, Snowbird, UT,Apr. 2012, pp. 3–12.
[9] Y. Lee, K. Hirakawa, and T. Q. Nguyen, “Lossless compression of CFA sampled image using decorrelated Mallat wavelet
packet decomposition,” in Proc. of ICIP’17, Beijing, China,Sep. 2017, pp. 2721–2725.
[10] M. Hernández-Cabronero, M. W. Marcellin, I. Blanes, andJ. Serra-Sagristà, “Lossless compression of color filter arraymosaic images with visualization via JPEG 2000,” IEEE Trans.
Multimedia, vol. 20, no. 2, pp. 257–270, Feb. 2018.
[11] “Kodak Lossless True Color Image Suite,” Kodak [Online],
Available: http://r0k.us/graphics/kodak/.
[12] I. Daubechies and W. Sweldens, “Factoring wavelet transforms
into lifting steps,” J. Fourier Anal. Appl., vol. 4, no. 3, pp. 247–269, May 1998.
[13] M. J. T. Smith and S. L. Eddins, “Analysis/synthesis techniques
for subband image coding,” IEEE Trans. Signal Process., vol.
38, no. 8, pp. 1446–1456, Aug. 1990.
[14] S. Andriani, H. Brendel, T. Seybold, and J. Goldstone, “Beyond the Kodak image set: A new reference set of color image
sequences,” in Proc. of ICIP’13, Melbourne, Australia, Sep.
2013, pp. 2289–2293.

1147