2015 International Conference on Advances in
Computers, Communication and Electronic Engineering 16 -18 March, 2015
PG Department of Electronics and Instrumentation Technology University of Kashmir, Srinagar, India
Color Image Compression using EZW and SPIHT Techniques M. Tariq Banday, Tawheed Jan Shah* Department of Electronics and Instrumentation Technology, University of Kashmir, Srinagar, India
Abstract Enormous digitized data produced from sequence of images requires huge storage space, processing speed and transmission time. To increase the processing speed and to decrease the storage space and transmission time, images are compressed with different compression techniques. Compression process is applied to image prior to its storage or transmission. Various image compression techniques have been developed to attain required compression ratios without losing quality of the image and information therein. This paper compares Embedded Zero Tree Wavelet Coding and Set Partitioning in Hierarchical Trees compression techniques by applying them on a color image in two standard resolutions 256x256 pixels and 512x512 pixels. The performance of these Discrete Wavelet Transform based techniques has been compared separately and mutually in terms of bits per pixel, peak signal to noise ratio and mean square error for the same colored image in order to determine the best possible compression technique. The results have been obtained using simulation through Matlab software.
Β© 2015 Published by University of Kashmir, Srinagar. Selection and/or peer-review under responsibility of Department of Electronics and Instrumentation Technology, University of Kashmir, Srinagar. Keywords: Image Compression; DWT; DCT; Embedded Zero Tree; Set Partitioning in Hierarchical Tree
1. Introduction Unprocessed multimedia data such as images, audio, video, text require huge storage space, transmission time and bandwidth (Gonzalez, Woods, 2004). Handling of such an enormous data can often present difficulties. However, proliferation of digital technology motivated for the need of improved image compression techniques. The two basic principles of image compression technique are irrelevancy and redundancy reduction, so that images can be stored or transmitted using fewer bits. The repetition of pixel or pattern across the image is called redundancy and is reduced either through Transform coding or predictive coding and irrelevancy is defined as that portion of data which is ignored by the human visual system and is reduced through the process of Quantization (Shapiro, 1993). Image compression techniques find applications in security industries, federal government agencies, galleries and museums, retail stores, medical science, etc. (ISO, 1991). Image compression techniques are broadly divided into two types: lossless and lossy technique. Lossless compression techniques are defined as those techniques in which there is no loss of information. It includes bit-plane coding, variable-length encoding, Adaptive dictionary algorithms such as LZW, lossless predictive coding, etc. while as lossy compression techniques are those in which there is some loss of information. It includes lossy predictive coding and Transform coding. However, at low bit rates, transform coding is considered as efficient. For a particular application, a compression technique offers advantages over the other techniques. In general, lossless Image compression techniques provide lower compression ratio and better image quality in comparison to the lossy compression techniques. The remaining paper is organized as follows: section II presents the background work. Section III gives an overview of discrete wavelet transform. Section IV discusses the wavelet based image compression techniques. Section V reports and discusses the results of experiments conducted with SPIHT and EZW coding techniques on two different image sizes followed by the conclusion.
* Corresponding author. Tel.: +91 9797 997886. E-mail address:
[email protected]. ISBN: 978-93-82288-63-3
Banday and Shah/COMMUNE β 2015
2. Background Study Nagamani and Ananth proposed an image compression technique for high resolution, grayscale Satellite urban images. The proposed technique used discrete wavelet transform together with EZW (Embedded Zero tree wavelet) and SPIHT (Set Partitioning in Hierarchical Trees) coding techniques in order to achieve high compression ratio and better image quality. The compression ratio and peak signal to noise ratio determined using EZW and SPIHT codings have been compared to each other for same set of images. The results obtained showed possibility to achieve higher compression ratio and PSNR (approximately CR of 8 and PSNR of 29.20) for SPIHT coding compared to EZW coding (approximately CR of 1.07 and PSNR of 13.07) for applications related to satellite urban imagery (Nagamani, Ananth, 2011). Ma Tao et al. surveyed multimedia compression and transmission techniques to analyze them for energy efficiency in resource-constrained platform in terms of compression efficiency, memory requirement, and computational load. For image compression three important techniques JPEG (DCT), JPEG2000 (Embedded Block Coding with Optimized Truncation EBCOT), and SPIHT have been discussed. It was concluded that SPIHT is the best choice for energyefficient compression algorithms due to its ability to provide higher compression ratio with low complexity. JPEG2000 (EBCOT) achieved higher compression ratio, which mean better quality than SPHIT, however, complexity of EBCOT tier-1 and tier-2 operations caused intensive complex coding, higher computational load, and more energy consumption for resource-constrained systems (Ma Tao, 2013). Singh et al evaluated DWT-EZW and DWT-SPIHT compression algorithms, based on parameters such as decomposition level, compression ratio, PSNR and compressed size. The results showed that DWT-SPIHT compression technique provided better image quality, PSNR value and compression ratio in comparison to the DWT-EZW technique (Pardeep et al, 2012). Singh et al proposed an effective image compression technique for Lossy Virtual Human Spine image. Two image compression techniques viz; EZW and SPIHT using different wavelet filters has been compared on the basis of compression ratio (CR), peak signal to noise ratio(PSNR), mean square error(MSE) and bits per pixel (BPP) values. Experimental results showed that PSNR in SPIHT increased by a factor of 13-15% as compared to the EZW technique. Further, SPIHT produced a fully embedded bit stream and offered better image quality at low bit rates than EZW (Priyanka, Priti, 2011). 3. Discrete Wavelet Transform Modern image processing applications employ transformation coding wherein correlation between adjacent pixels is exploited to compress images (Wern et al, 2008). The adjoining pixels of the image are predicted with highest degree of accuracy. The transformation is a lossless process and it transforms the correlated information into uncorrelated coefficients. In transformed domain, image information proves to be more competent rather than the image itself. The compression is provided by processing and quantization of the transformed coefficients. Discrete Cosine Transform (DCT) (Watson, 1994) and Discrete Wavelet Transform (DWT) are two extensively used transformation techniques. Because of a number of advantages of DWT such as high compression ratio, better image quality, progressive transmission etc. it has become very popular. Through Discrete Wavelet Transform (DWT), a signal with good resolution can be analyzed in both time and frequency domains using a basic set of functions called wavelets (Yea et al, 2006). Wavelet comes from fact that they integrate to zero. Wavelets tend to be irregular and asymmetric. Wavelet based coding is very robust under transmission errors as compared to the DCT based coding. Through DWT (Mammeri et al, 2012), higher compression can be achieved as it decomposes time domain signal into different frequency bands through a series of high and low pass filters. The mathematical expression for wavelet transform is given by: β
πΉ[π, π] = β«ββ π(π)π β (π, π)(π)ππ₯ -- (1) Where * is complex conjugate symbol and Ο is some function. 4. Wavelet Based Image Compression Techniques Embedded Zero Tree Wavelet (EZW) and Set partitioning in hierarchical trees (SPIHT) coding techniques based on wavelet transform are widely used for still image compression. These techniques are explained below: 4.1.
Embedded Zero Tree Wavelet Coding
Embedded Zero Tree Wavelet (EZW) coding, introduced by Shapiro (Shapiro, 1993) is considered as one of the effective and powerful wavelet based lossless image compression algorithm. This algorithm is sometimes called embedded coder because the compression process stops when a desired bit rate is reached. It does not require any training, tables, codebooks or any prior information about the image. EZW algorithm performs quantization through entropy-coded successive approximations, and uses DWT or hierarchical subband decomposition. The performance of
[62]
Banday and Shah/COMMUNE β 2015
this algorithm is based on the self-similarity across these different sub-bands and successive approximation methods. A fully embedded code representing a series of binary decisions is produced from the bit stream produced by EZW algorithms. The following main steps are involved in this algorithm: Initialization: Set the threshold βTβ to the smallest power of β2β that is greater than max(m, n) |c(m,n)|/2 , where c(m, n) are the wavelet coefficients. b) Significance map coding: Scan all the coefficients in a predefined way and output a symbol when |c(m, n)|>2. When the decoder inputs this symbol, it sets c(m, n) = Β±1.5T. c) Refinement: Refine each significant coefficient by sending one more bit of its binary representation. When the decoder receives this, it increments the current coefficient value by Β±0.25T. d) Set T=T/2, and repeat step 2 if more iterations are required (Raja, Suruliandi, 2010). a)
4.2.
Set Partitioning in Hierarchical Trees
Said and Pearlman, developed the Set Partitioning in Hierarchical Trees (SPIHT) wavelet coder in 1996 (Said, Pearlman, 1996). Both SPIHT and EZW use the basic idea of zerotree coding. This coding technique uses three coefficient location lists namely the List of significant Pixels (LSP), List of Insignificant Sets (LIS), and List of Insignificant Pixels (LIP) that contain their coordinates. It involves two steps for each iteration: the sorting pass and the refinement pass. Sorting pass results in the organized lists and the refinement pass does the real coding, which ultimately leads to a fully embedded bit-stream. SPIHT coder is restricted to images having pixel resolution of power 2. It provides higher PSNR with better image quality, low power consumption, compact output bit-stream, less complexity, and an intensive progressive transmission capability. 5. Experiments and Results
60
60
50
50
40
40
PSNR
PSNR
Colored image compression based on EZW and SPIHT encoding techniques has been undertaken using Wavelet Toolbox of MATLAB version 7.11.0 (R2010b) on Windows 7, 64-bit OS, with Intel Core i3 processor having, 2GB of RAM. Two same colored images of Jellyfish with standard pixel resolutions of 512x512 pixels and 256x256 pixels have been used. Both images named Jellyfish1 (512x512 pixels) and Jellyfish2 (256x256 pixels) which originally are in BMP format have been compressed using SPHIT and EZW coding techniques. In order to compress the colored image, the image is separated into three channels. On each channel, discrete wavelet transform and encoding is performed separately using input parameters viz; name of the wavelet and encoding technique. The three separately compressed channels are combined together to get the final output image which is in the compressed form. The results are analyzed, compared to each other, and discussed below. To achieve high compression and good quality so that it can be perceived by a human eye correctly and clearly, compression of both above-mentioned images was undertaken with different values of BPP (bits per pixel). In case of SPIHT encoding, the range for BPP remained from 0.038 (with 10 iterations) to 1.2339 (with 15 iterations) for 512x512 pixels image and 0.1499 (with 10 iterations) to 2.1466 (with 15 iterations) for 256x256 pixels image. These values in case of EZW remained from 0.1268 (with 10 iterations) to 3.5512 (with 15 iterations) and 0.4561 (with 10 iterations) to 4.5082 (with 15 iterations) respectively for 512x512 and 256x256 pixels image. The whole image was compressed for all of the above-mentioned values of BPP. Compression Ratio, PSNR and MSE, were calculated for the two techniques discussed above. PSNR vs. Bits per Pixel (BPP) of 512x512 image and 256x256 image are shown in figures 1(a) and 1(b) below:
30
30 20
20
EZW (256x256 pixels)
EZW (512x512 pixels) 10
10
SPIHT (256x256 pixels)
SPIHT (512x512 pixels) 0
0 0
0.5
1
1.5 2 2.5 3 3.5 BITS PER PIXEL (BPP)
4
4.5
0
5
(a)
0.5
1
1.5 2 2.5 3 3.5 BITS PER PIXEL (BPP) (b)
Fig. 1. (a) PSNR Vs. Bits Per Pixel (BPP) of 512x512 pixels image; (b) PSNR Vs. Bits Per Pixel (BPP) of 256x256 pixels image
[63]
4
4.5
5
Banday and Shah/COMMUNE β 2015
For 512x512 pixels image, both SPIHT and EZW showed PSNR above 35dB while as the BPP varied from 0.038 to 3.5512. Higher compression ratio of 16.4851 was obtained in SPIHT technique. Highest PSNR of 49.9057 was obtained using EZW technique. For 256x256 pixels image, SPIHT and EZW both showed PSNR above 36dB while as the BPP varied from 0.1499 to 4.5082, which is higher, than that for 512X512 pixels image. Higher compression ratio of 7.1707 was obtained using SPIHT technique. On observing the results, it is clear that SPIHT coding provides better image quality and higher compression ratio using less BPP in comparison to the EZW coding techniques. Figures 2(a) and 2(b) show MSE vs. Bits per Pixel (BPP) of 512x512 pixels and 256x256 pixels images. The MSE remained below 17.9538 for both techniques in case of 512x512 pixels image at 0.038 BPP while as in case of 256x256 pixels image; this value remained below 14.4617 at 0.1499 BPP. Further higher compression ratio and MSE of 16.4851 and 17.9538 respectively, at 0.038 BPP for 512x512 pixels image was found using SPIHT technique. EZW (512x512 pixels)
18
SPIHT (512x512 pixels)
15
SPIHT (256x256 pixels)
15
MSE
12
MSE
EZW (256x256 pixels)
18
9
12 9
6
6
3
3 0
0 0
0.5
1
1.5 2 2.5 3 3.5 BITS PER PIXEL (BPP)
4
4.5
0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5
5
BITS PER PIXEL (BPP)
(a)
(b)
Fig. 2. (a) MSE Vs. Bits Per Pixel (BPP) of 512x512 pixels image; (b) MSE Vs. Bits Per Pixel (BPP) of 256x256 pixels image
60
60
50
50
40
40
PSNR
PSNR
Figure 3(a) and 3(b) show comparison between 512x512 pixels and 256x256 pixels image using SPIHT and EZW techniques respectively, on the basis of PSNR Vs. Bits Per Pixel. For 512x512 pixels and 256 x256 pixels image compressed using SPIHT showed higher PSNR value of 47.9547 at 1.2339 BPP and 49.5301 at 2.1468 respectively. A higher compression ratio of 16.4851 at 0.038 BPP was obtained for 512x512 pixels image using SPIHT as compared to the 256x256 pixel where a higher compression ratio of 7.1707 at 0.1499 BPP was obtained.
30 20
30
20 SPIHT (512x512 pixels)
EZW (512x512 pixels)
10
10
SPIHT (256x256 pixels)
EZW (256x256 pixels)
0
0 0
0.5
1
1.5 2 2.5 3 3.5 BITS PER PIXEL (BPP)
4
4.5
5
0
0.5
1
1.5 2 2.5 3 3.5 BITS PER PIXEL (BPP)
4
4.5
5
(b)
(a)
Fig. 3. (a) Comparison of 512x512 pixels and 256x256 pixels image using SPIHT (PSNR vs. Bits per Pixel); (b) Comparison of 512x512 pixels and 256x256 pixels image using EZW (PSNR vs. Bits per Pixel)
For 512x512 pixels and 256x256 pixels image compressed using EZW showed higher PSNR value of 49.9057 at 3.5512 BPP and 50.1811 at 4.5082 respectively. A higher compression ratio of 15.1396 at 0.1268 BPP was obtained for 512x512 pixels image using EZW as compared to the 256x256 pixel where a higher compression ratio of 6.8412 at 0.4561 BPP was obtained. From the above-explained results, it is concluded that SPIHT and EZW for 512x512 pixels image shows outstanding performance in terms of compression ratio.
[64]
Banday and Shah/COMMUNE β 2015
20
20
SPIHT (512x512 pixels) SPIHT (256x256 pixels)
EZW (256x256 pixels)
15
MSE
MSE
15
EZW (512x512 pixels)
10
10
5
5
0
0 0
0.5
1
1.5
2
2.5
3
3.5
4
4.5
5
0
BITS PER PIXEL (BPP)
0.5
1
1.5
2
2.5
3
3.5
4
4.5
5
BITS PER PIXEL (BPP)
(a)
(b)
Fig. 4. (a) Comparison of 512x512 pixels and 256x256 pixels image using SPIHT (MSE vs. Bits per Pixel); (b) Comparison of 512x512 pixels and 256x256 pixels image using EZW (MSE vs. Bits per Pixel)
Comparison of 512x512 and 256x256 image using SPIHT and EZW on the basis of MSE Vs. Bits Per Pixel (BPP) is shown in Figure 4(a) and 4(b). For 512x512 and 256x256 pixels image compressed using SPIHT showed a lower MSE value of 1.0414 at 1.2339 BPP and 0.7246 at 2.1466 respectively. While as for 512x512 and 256x256 pixels image compressed using EZW showed a lower MSE value of 0.6645 at 3.5512 BPP and 0.6328 at 4.5082 BPP respectively. Also it is clear from the Figure 4(a) and 4(b) that SPIHT and EZW coding technique for 256x256 image showed outstanding performance in terms of MSE. Further high compression ratio and MSE was achieved in 512x512 pixels image. 6. Conclusion Application of discrete wavelet transformation with EZW and SPIHT coding to the colored images having pixel dimensions of 512x512 pixels and 256x256 pixels suggested effective compression at nearly no loss of quality of the image. Discrete wavelet transform based SPIHT coding showed outstanding performance in terms of compression ratio, PSNR and MSE. In comparison to the EZW coding, SPIHT coding not only used less BPP but also provided reasonable image quality at higher compression ratios. The results show maximum compression ratios of 16.4851 using SPIHT and that of 7.1707 using EZW for 512x512 pixels and 256x256 pixels images respectively. For both of these approaches, PSNR remained above 35dB, which is sufficient for perceiving the image correctly by humans. In addition, SPIHT coding technique used less time during the execution process. References Abdelhamid, M., Brahim, H., Ahmed, K., 2012. A survey of image compression algorithms for visual sensor networks, ISRN Sensor Networks, p. 1β 19. Gonzalez, R.C., Woods, R.E., 2004. Digital Image Processing, Reading. MA: Addison Wesley. ISO. Nov. 1991. Digital compression and coding of Continous-tone still images, part1, requirements, and Guidelines, ISO/IES JTC1 Draft International Standard 10918-1. Nagamani, K., Ananth, A., G., April -June 2011. EZW and SPIHT Image Compression Techniques for High Resolution Satellite Imageries, International Journal of Advanced Engineering Technology Computer Application, Vol. 2 , Issue 2 , P. 82-86, ISSN:0976-3945. Raja, S., P., Suruliandi, A., 2010. Performance Evaluation on EZW & WDR Image Compression Techniques, IEEE Trans on ICCCCT. Said, A., Pearlman, W., A, 1996. A new, fast, and efficient image codec based on set partitioning in hierarchical trees, IEEE Transactions on Circuits and Systems for Video Technology, Vol. 6, no. 3, p. 243β 250. Shapiro, J.M., 1993. Embedded Image Coding Using Zerotrees of Wavelet Coefficients, IEEE Transactions on Signal Processing, Vol. 41, p. 34453462. Singh, P., Nivedita, Gupta, D., Sharma, S., Sep 2012. Performance Analysis of Embedded Zero Tree and Set Partitioning In Hierarchical Tree, International Journal of Computer Technology & Applications, Vol. 3, p. 572-577, ISSN:2229-6093. Singh, P., Singh, P., Dec 2011. Design and Implementation of EZW & SPIHT Image Coder for Virtual Images, International Journal of Computer Science and Security IJCSS, Vol. 5, Issue 5, Kuala Lumpur, Malaysia, p. 433-442. Tao, M., Hempel, M., Dongming, P., Sharif H., 2013. A survey of energy-efficient compression and communication techniques for multimedia in resource constrained systems, IEEE Communications Surveys &Tutorials, Vol. 15, No. 3, p. 963β972. Watson, A., B., 1994. NASA Ames Research Canter, Image Compression Using the Discrete Cosine Transform, Mathematica Journal, Vol. 4, no. 1, p. 81-88. Wern, C.L., Ang, L.M., Phooi, S.K., 2008. Survey of image compression algorithms in wireless sensor networks, In: IEEE information technology, IT Sim 2008, International symposium, Vol. 4, p. 1β9. Yea, S., A., Pearlman, W., 2006. A Wavelet-Based Two-Stage Near-Lossless Coder, IEEE Transactions on Image Processing, Vol. 15, no. 11, p. 3488-3500.
[65]