Hybrid Image Compression Using DWT, DCT and Huffman Coding Techniques Veerpal kaur, Gurwinder kaur Abstract- Here in this hybrid model we are going to proposed a Nobel technique which is the combination of several compression techniques. Image compression is minimizing the size in bytes of a graphics file without degrading the quality of the image to an unacceptable level. The reduction in file size allows more images to be stored in a given amount of disk or memory space. It also reduces the time required for images to be sent over the Internet or downloaded from Web pages.jpeg and JPEG 2000 are two important techniques used for image compression. First we implement DWT and DCT on the original image because these are the lossy techniques and in the last we introduce Huffman Coding technique which is a lossless technique. In the end, we implement lossless technique so our PSNR and MSE will go better than the old algorithms and due to DWT and DCT we will get good level of compression. Hence overall result of hybrid compression technique is good. Index Terms: Compression ratio, DCT, DWT, Huffman Coding, Image Compression. I. INTRODUCTION Image compression literally means reducing the size of graphics file, without compromising on its quality. Depending on whether the reconstructed image has to be exactly same as the original or some unidentified loss may be incurred, many techniques for compression exist [4].Image compression is all about minimizing the size of image in bytes of a graphics file without degrading the quality of the image to an unacceptable level. There are several different ways in which image files can be compressed. The image compression is used widely whose purpose is reducing the image quantity as much as possible, while keep the image's content constantly, or the image compression must not because image's significant changes [1]. Image compression plays an important role in the transmission and storage of image information as a result of bandwidth and storage limitations. The goal of image compression is to represent an image in the fewest number of bits without losing the essential information content within an image. There are several image compression techniques [2]. Image compression is an essential technology in multimedia and digital communication fields. Most of the existing image coding algorithm is based on the correlation between adjacent pixels and therefore the compression ratio is not high [3]. II. TYPES OF COMPRESSION In lossless compression schemes, the reconstructed image, after compression, is numerically identical to the original image. However lossless compression can only achieve a modest amount of compression. An image reconstructed following lossy compression contains degradation relative to the original. Often this is because the compression scheme completely discards redundant information. However, lossy schemes are capable of achieving much higher compression. Under normal viewing conditions, no visible loss is perceived (visually lossless) [7]. III. PROBLEM SOLUTION USING THREE TECHNIQUES When more than one compression technique are applied to compressed one image for high value of PSNR (peak signal to noise ratio) and CR (compression ratio) this process is called hybrid compression technique.this technique consist of two step. In first step lossy compression technique is are applied to compress image and in second step lossless compression technique is applied so that PSNR (peak signal to noise ratio) value and CR (compression ratio) could be maintained. DISCRETE WAVELET TRANSFORM Wavelets are functions defined over a finite interval and having an average value of zero. The basic idea of the wavelet transform is to represent any arbitrary function (t) as a superposition of a set of such wavelets or basis functions. These basis functions or baby wavelets are obtained from a single prototype wavelet called the mother wavelet, by dilations or contractions (scaling) and translations (shifts). The Discrete Wavelet Transform of a finite length signal x(n) having N components, for example, is expressed by an N x N matrix. For a simple and excellent introduction to wavelets [7].The Discrete Wavelet Transform (DWT), on the other hand, has been emerged as an efficient tool for medical image compression, mainly due to its ability to display image at different resolutions. It also offers higher compression ratio. In, Singh et al. have applied a hybrid algorithm to images of 512x512 resolutions. It uses a 5-1evel DWT decomposition which requires large computational resources. The analysis is limited to images only [5]. DISCRETE COSINE TRANSFORM Image Compression using Discrete Cosine Transform Discrete cosine transform (DCT) is widely used in image processing, especially for compression. The discrete cosine transform (DCT) represents an image as a sum of sinusoids of varying magnitudes and frequencies. The dct2 function computes the two-dimensional discrete cosine transform (DCT) of an image. The DCT has the property that, for a typical image, most of the visually 107
significant information about the image is concentrated in just a few coefficients of the DCT. DCT is often used in image compression applications. For example, the DCT is at the heart of the international standard lossy image compression algorithm known as JPEG. (The name comes from the working group that developed the standard: the Joint Photographic Experts Group.) JPEG PROCESS Original image is divided into blocks of 8 x 8. Pixel values of a black and white image range from 0-255 but DCT is designed to work on pixel values ranging from -128 to 127. Therefore each block is modified to work in the range. Equation is used to calculate DCT matrix. Each block is then compressed through quantization. Quantized matrix is then entropy encoded. Compressed image is reconstructed through reverse process. Inverse DCT is used for decompression. USING HUFFMAN CODING Huffman code is a technique for compressing data. Huffman's greedy algorithm looks at the occurrence of each character and it as a binary string in an optimal way. Huffman coding is a form of statistical coding which attempts to reduce the amount of bits required to represent a string of symbols. The algorithm accomplishes its goals by allowing symbols to vary in length. Shorter codes are assigned to the most frequently used symbols, and longer codes to the symbols which appear less frequently in the string (that's where the statistical part comes in). Code word lengths are no longer fixed like ASCII.Code word lengths vary and will be shorter for the more frequently used characters [8]. Huffman coding is based on the frequency of occurrence of a data item (pixel in images). The principle is to use a lower number of bits to encode the data that occurs more frequently. Codes are stored in a Code Book which may be constructed for each image or a set of images. In all cases the code book plus encoded data must be transmitted to enable decoding.1.adaptive Huffman coding the key is to have both encoder and decoder to use exactly the same initialization and update model routines. Update model does two things: (a) increment the count, (b) update the Huffman tree. During the updates, the Huffman tree will be maintained its sibling property, i.e. the nodes (internal and leaf) are arranged in order of increasing weights [6]. using hybrid compression technique using DWT, DCT and Huffman coding technique at different compression levels and then compare compression times for it. First we compress image at level 1 and then at level 2, level 3, level 4, level 5 and level 6 respectively. Here one can notice the change in image and values of compression time and PSNR values. Table 1 Table of PSNR for Compression Level S.NO Compression level PSNR 1 Level=1 22.0624 2 Level=2 21.4286 3 Level=3 20.9165 4 Level=4 19.9580 5 Level=5 18.3350 6 Level=6 17.0011 Graph Showing Decrease in PSNR with increase in compression level is shown below which is accompanied with original image for which values are taken. We see the table of PSNR for compression level in which at the level of 1 we get 22.0624 value of the PSNR. At the level of 2 we get 21.4286 value of the PSNR. At the level 3 value of PSNR is 20.9165. At the level of 4 value of PSNR is 19.9580, level of 5 value of PSNR is18.3350.and the last level of 6 then value of PSNR is17.0011. In which we see at the level of 1 it will increase the PSNR value and at the level of 6 it will decrease the value of PSNR. IV RESULTS AND DISCUSSION We apply this algorithm to compress image at different compression levels and as we increase the level PSNR (Peak Signal-to-Noise Ratio) Decreases with every increase of level. We take six values of level and for each level PSNR (Peak Signal-to-Noise Ratio) is noted down which clearly shows that PSNR decreases with increase in level and it is shown in a graph of level versus PSNR (Peak Signal-to-Noise Ratio). Decreased PSNR (Peak Signal-to-Noise Ratio) makes it difficult to reconstruct original image. We take an image and compress it by Figure 3 Original Image and Graph of Level versus PSNR 108
Original image at level 1 DWT, DCT hybrid compression at level 1 Compressed image after DWT at level 1 Huffman Compressed image at level 1 109
Original image at level 6 DWT, DCT hybrid compression at level 6 Compressed image after DWT at level 6 Huffman Compressed image at level 6 110
Hybrid compression techniques uses advantages of all three techniques, like compression time for DCT is lowest, DWT is moderate and Huffman coding. Compression takes highest time. But at the same time quality of image after decompression in DCT and DWT is not good as compared to Huffman coding. In Huffman algorithm we get decompressed image same as original image. Table 2 Table of Compression Time for Compression Level Compression Level DCT Time DWT Time Huffman Time 1 0.0781 0.6959 19.7054 2 0.0802 0.7246 19.5524 3 0.0774 0.7557 19.4803 4 0.0827 0.7388 19.5775 5 0.0833 0.7604 19.3778 6 0.0815 0.7502 18.7813 Figure 5 Graph of Compression Level versus DWT Time Figure 4 Graph of Compression Level versus DCT Time Figure 6 Graph of Compression Level versus Huffman Time 111
CONCLUSION We have proposed a new compression method which is a combination of three compression schemes DWT, DCT and Huffman compression. Here in our work DWT and DCT is very good to cope up compression ratio but as they are lossy techniques so our quality measurement which we are concluded with the help of PSNR is decreasing due to so, further to enhance CR we are using Huffman compression method because of its lossless compression nature and it will provide us good PSNR and high CR value. This concludes that after applying lossy techniques it s better to use lossless too to enhance compression at same PSNR. Future scope Proposed a new compression method gives very good results and it leaves good probability for further expansion. This work can be expanded with applying it for the videos to get better PSNR at high CR. Object based video compression will also be used after Huffman compression for videos. Algorithms, International Journal of Electronics & Communication Technology, IJECT Vol. 2, Issue 1, March 2011. 8. Mridul Kumar Mathur, Seema Loonker, lossless huffman coding technique for image compression and reconstruction using binary trees, Int.J.Comp.Tech.Appl, Vol. 3 (1), janfeb 2012. Veerpal Kaur has received her Bachelor of Technology in Electronics and Communication from Bhai Mahan Singh College of Engineering, Mukatsar, PTU Jalandhar and pursuing Master of Technology in Electronics and Communication from Yadwindra College of Engineering, Guru Kashi Campus Talwandi Sabo, Punjabi University, Patiala (Punjab) and her field of specialization is Digital Signal Processing. REFERENCES 1. Zhang Shi-qiang, Zhang Shu-fang, Wang Xinnian, Wang Yan The Image Compression Method Based on Adaptive Segment and Adaptive Quantified, The 3rd International Conference on Innovative Computing Information and Control (ICICIC'08)IEEE, 2008. 2. Ali Al-fayed, Abir Jafar Hussain, Paulo Lisboa and Dhiya Al-Jumeily An Adaptive Hybrid Classified Vector Quantisation and Its Applications to Image Compression, Second UKSIM European Symposium on Computer Modeling and Simulation, IEEE, 2008. 3. Chong Fu, Zhi-Liang Zhu A DCT-Based Fractal Image Compression Method, International Workshop on Chaos-Fractals Theories and Applications IEEE, 2009. 4. Sunil Bhooshan and Shipra Sharma, An Efficient and Selective Image Compression Scheme using Huffman and Adaptive Interpolation, 24th International Conference Image and Vision Computing New Zealand IEEE, 2009. Mrs. Gurwinder Kaur has completed her M.Tech. degree from PTU, Jallandhar and works as an Assistant Professor & Head of department of ECE in Yadwindra College of Engineering, Guru Kashi Campus Talwandi Sabo, Punjabi University. She has more than seven years of teaching and research experience and her areas of specialization are Digital signal Processing, fuzzy logic control. Her publications include two international and three national research papers on WCDMA and fuzzy logic control. 5. Suchitra Sheathe and Khan Wahid, Hybrid DWT-DCT Algorithm for Bio-Medical Image And Video Compression Applications, 10th International Conference on Information Science, Signal Processing and their Applications IEEE, 2010. 6. Mamta Sharma, Compression Using Huffman Coding, IJCSNS International Journal of Computer Science and Network Security, VOL.10 No.5, May 2010. 7. Sachin Dhawan A Review of Image Compression and Comparison of its 112