© ICST Institute for Computer Sciences, Social Informatics and Telecommunications Engineering 2019
Jin Li, Zheli Liu and Hao Peng (eds.)Security and Privacy in New Computing EnvironmentsLecture Notes of the Institute for Computer Sciences, Social Informatics and Telecommunications Engineering284https://doi.org/10.1007/978-3-030-21373-2_62

Zone Based Lossy Image Compression Using Discrete Wavelet and Discrete Cosine Transformations

Nafees Ahmad1  , Khalid Iqbal2  , Lansheng Han1  , Naeem Iqbal2   and Muhammad Adil Abid3  
(1)
School of Computer Science and Technology, Huazhong University of Science and Technology, Wuhan, 430074, Hubei, People’s Republic of China
(2)
Department of Computer Science, COMSATS University Islamabad, Attock Campus 43600, Islamabad, Pakistan
(3)
Department of Computer Science and Technology, Shandong University, Jimo, Qingdao, 266237, People’s Republic of China
 
 
Nafees Ahmad
 
Khalid Iqbal
 
Lansheng Han (Corresponding author)
 
Naeem Iqbal
 
Muhammad Adil Abid

Abstract

Due to the huge volume of image data generation in numerous domains, image compression has got the attention of researchers to minimize redundant image contents for efficient handling and transmission. However, a small region of interest (ROI) in the whole image is a major challenge in image compression. In this perspective, lossless image compression techniques have a low compression rate, and lossy image compression approaches, like JPEG, JPEG2000 and HD Photo, slightly loose data with high compression ratio. High compression ratio of lossy image compression helps in saving storage and fast transfer of data. In this paper, we proposed new DWT based zoning technique in combination with DCT for image compression. DWT divides an image into LL, LH, HL and HH frequencies and Zoning is further dividing these images into four parts as an input to DCT one after another. The output of DCT on each zone is then combined into a compressed bitstream image. Extensive experimentation is performed on various common images to compare the results with JPEG, JPEG2000 and HD Photo methods. Our ZDD methods remarkably performed better than the aforementioned techniques.

Keywords

Lossy image compressionDiscrete Cosine TransformDiscrete Wavelet Transform

1 Introduction

Rapid growth of multimedia applications and increasing of the high-resolution images on a large scale create the problem of storage and transferring of data [13]. Compression techniques are the application of image processing that deals with the reduction of bits to represent the image. Attractive part of image compression is the resolution of the image. Nowadays, it plays a leading role in many application i.e., quality improvement in satellite images [4], enhancement of resolution in a video [5] and feature computation [6]. Generally, two kinds of resolution methods exist in image processing, single image super-resolution and multi-image super-resolution method. The algorithms [79] of multiple-image super-resolution accept the low-resolution images of same scene in the form of input and perform registration technique to transform images for their size reduction. The output information is then combined with the distorting constraints of low-quality input images to develop a high-quality framework for showing the output of the high-resolution image. For appropriate working of super-resolution image algorithm, the smaller pixels in low-resolution images should be repositioned. It is very crucial to reposition the smaller pixels; these pixels can be repositioned by registration techniques. The repositioning of pixels in objects like a model of a human being is more complex.

Perhaps, algorithms in [10] achieve high-quality output; though, the enhancement aspects are constraint by factors near to 2. The algorithms [1113] for single-image super-resolution cannot relocate smaller pixels due to the only input. In replacement, these algorithms make the learning model on the basis of low resolution and high-resolution images counterpart through training. Consequently, in the later stage, these models predict the missing pixels of the low-resolution image. Indeed, based on trained features between high-quality and low-quality images, the tested output of these algorithms is much better to enhance compression of the input image. Therefore, the reduction and regeneration of high-quality images are very essential. In compression of an image, there is a very vital part of information theory. Importantly, the dimension of the data i.e. histogram can be decreased by using information theory [14, 15]. Lossy and Lossless are the two methods for compressing the image [16, 17]. In lossy compression technique, the compressed image cannot be restored to its original image because of losing some information due to compression while on the other hand in lossless compression method, the compressed image can be restored to its original image. Lossy image compression technique is renowned for compression; it gives higher compression than lossless compression. Lossless compression technique considers risk with an aim to avoid loss of information, for example in medical image processing, high information required related patient to identify the disease. The primary purpose of this technique is to decrease the image size as much as possible without losing the content of the image [18]. However, in case of lossy compression, loss of information is acceptable within the boundary.

Wavelets importantly involved in Internet-based applications. It deals with the image compression and signal processing. Usually, this method compressed image in a large manner than other techniques like JPEG [11, 19]. In Discrete Wavelet Transform (DWT), initially, an operation performed on the row of the image to get the input value and then used on the columns. This procedure is called two-dimension wavelet breakdown of the image [20, 21]. This procedure accomplishes the image into four smaller bands including High-High (HH), Low-Low (LL), High-Low (HL) and Low-High (LH). The frequency of the original image is wrapped completely by the frequency of the smaller bands.

In this work, we proposed a new way of lossy image compression technique, named as ZDD, which is based on DWT and Discrete Cosine Transform (DCT) by performing zoning on result of DWT. The objective of the ZDD method is to improve the PSNR while compressing an image. In our research work, the basic ingredient is zoning that helps in recognizing the deep parts of the image and that can be focused more accurately for better and efficient results. The goal of ZDD is to reduce the size of original image to make more space for storage of a variety of images. The quantitative and visual results prove that the proposed methodology is more helpful for lossy compression of an image. Our lossy image compression method can be used as it leads better results in comparison to the existing ones. We used benchmark dataset contains 15 colour based images for experimental purpose. On the basis of PSNR values, the results are evaluated to validate our proposed research. DCT decreases the psychovisual dismissals of any image and the DCT lossy compression image is a quantization method [22, 23]. The quality of the decompressed picture can be improved by using DWT. While DCT works with the boundary points and for producing accurate calculation results cosine is used instead of sine. It takes different frequencies and makes a flow for data points and then summing those points by using cosine. Furthermore, DCT works better for smaller high-frequency bands [24]. Therefore, DCT is chosen to get the input of DWT based four zones with deep information.

2 Related Work

This section introduces the background information and related work of image compression technology. Many states of the art image compression techniques are available, such as Wavelet Compression Technique (WCT) [19], Discrete Wavelet Transform (DWT) [4] etc. All of these techniques play an important role in many image processing applications.

2.1 Wavelet Compression Technique (WCT)

Wavelet Compression Technique is often used in many image processing applications. It is specifically used for resolution enhancement-based applications.

Different authors have proposed different image enhancement models based on wavelet transform. In [25], the author proposes a technique to improve image resolution by interpolating the high sub-bands of SWT and DWT. Initially, SWT was used to improve the boundary of the image. Then, DWT is used in parallel with SWT to decompose the image into four sub-bands. After that, the input image plus high-frequency bands are interpolated and the estimated high-frequency sub-bands are generated through SWT high sub-bands. Lastly, the inverse of discrete cosine transformation (IDWT) is used to combine all sub-bands to produce a new high- quality image. The block diagram of [25] is illustrated in Fig. 1.
../images/485150_1_En_62_Chapter/485150_1_En_62_Fig1_HTML.png
Fig. 1.

The framework proposed in [25]

2.2 Discrete Wavelet Transform (DWT)

In order to obtain a high-resolution image using DWT, a new learning-based technique is proposed [26]. This method’s novelty comes in the domain of wavelet-based specific application design. Initially, super-resolution image approximation is achieved by filter coefficients and high-frequency wavelet information in the wavelet domain (WD). On this basis, the regularization framework based on sparse distribution is used to degrade the image. Finally, output image is calculated from initial super-resolution and wavelet coefficients. The one advantage of this algorithm is; it learns from initial approximation rather than using registered image. Moreover, this method uses sparse priority to preserve neighbourhood dependencies. Another advantage of the method is to use wavelet coefficients to present the best point range function to simulate the achievement process of the image.

A learning-based approach is presented in Fig. 2 proposed by [28]. This method takes a database of low-resolution and high-resolution images as input. Initially, authors acquired the high-frequency sub-bands from database images by using DWT. Using high-frequency details, an initial high-resolution image was destroyed and then images were modelled with aliases and noise. In the next step, the original image and test image was used to determine the aliasing entries. The early model of the super-resolution image was selected as an In-homogeneous Gaussian Markov Random Field (IGMRF). At the final stage, maximum posterior (map) approximation method was applied in order to get the minimum cost function.
../images/485150_1_En_62_Chapter/485150_1_En_62_Fig2_HTML.png
Fig. 2.

The framework of Discrete wavelet transform in [27]

In article [29], authors used DWT to divide the image into four sub-bands (HH, HL, LH, and LL). They used DWR to compress the Low-Low (LL) subband and SVD to compress high-frequency subbands (HH, HL, and LH). The proposed approach has been validated in a number of well-known images, including airfields, peppers, Lena and boats. The results were compared with WDR and JPEG2000. This technique showed improvement in term of PSNR and visual result than these existing methods.

2.3 Zoning

This technique refers to divide the image into N parts which can grab discriminative depth detail of image as much as possible. Suppose I is an image, zoning method generally divide the image into N zones i.e., Z1, Z2 … Zn (N > 1). Each zone provides depth information of an image. Zoning is not only useful for the lossy type of image compression but also useful in medical image compression when each pixel is critically essential. In medical imaging, initially zones defined the depth location of an image and then further operation has been performed over those zoned areas. When compression technique is applied then zones can neglect the most irrelevant information, the useful information still remains there. Hence, it is a more useful technique in many lossy image compression applications. Different authors have proposed zoned based models for different problems such that character recognition, identifying facial expressions from the images. Jin et al. [28] divided the image 4 × 4, 4 × 9, 4 × 16, 8 × 8 and 10 × 10 zones in recognition of Chinese characters. They computed the directional features from those separated grids. One more study [29] has also done on Chinese character recognition through zoning. In this work Liu et al. used a direct decomposition method on 4 × 4 grids. Pal and Chaudhuri et al. [30] presented their work on character recognition on the base of zone information. In this work, the authors suggested the Indian language for their character recognition on the base of zoning. In [31], authors worked on the recognition of car plates. They divided the car plate image into 4 × 4 zones to compute pixel depth feature. In [6], the authors proposed a zone-based model for identifying the facial expressions from an image. In this work, authors fetched the required information from the marked regions or zones and then apply their proposed technique to recognize facial expression. Authors in [14] proposed a model to the visual objects within an image based on the frequency domains and the region-based zones. In this work, a hybrid model is presented to visualize objects within an image. For this, the authors divided an image into two different parts such that frequency domains and region-based zones. Firstly, the authors applied frequency domain features on the grids; secondly, a region-based part was highlighted. They made more clear visualization among the various images which were tested and utilized in their research work. Hence the zone-based approach makes work more easily with high accuracy comparatively.

2.4 Discrete Cosine Transform (DCT)

DCT plays a vital role in lossy image compression. DCT actually works with the boundary points, to get accurate results cosine is used instead of sine. It takes different frequencies, makes a flow for data points, and then sums those points by using sum function of cosine. If there is a need to skip smaller high-frequency sub-bands then DCT works better and that is the reason to choose DCT in proposed research work.

The DCT for 2D image I of size M × N can be calculated from below equation:
$$ D_{ct} = \beta_{c} \beta_{t} \sum\nolimits_{i = 0}^{M - 1} {\sum\nolimits_{j = 0}^{N - 1} {I_{ij} \cos \frac{{\pi \left( {2i + 1} \right)c}}{2M}\cos \frac{{\pi \left( {2j + 1} \right)t }}{2N}      \left\{ {\begin{array}{*{20}c} {0 \le c \le M - 1} \\ {0 \le t \le N - 1} \\ \end{array} } \right.} } $$
(1)
Where
$$ \beta_{c} = \left\{ {\begin{array}{*{20}l} {\frac{1}{\sqrt M },} \hfill & {c = 0} \hfill \\ {\sqrt {\frac{2}{M}} ,} \hfill & { 0 \le c \le M - 1} \hfill \\ \end{array} } \right.\,\,\,\,\,\beta_{t} = \left\{ {\begin{array}{*{20}l} {\frac{1}{\sqrt N },} \hfill & {t = 0} \hfill \\ {\sqrt {\frac{2}{N}} ,} \hfill & {0 \le t \le N - 1} \hfill \\ \end{array} } \right. $$
The original image can get by using the inverse of DCT, the following equation can calculate IDCT:
$$ I_{ij} = \sum\nolimits_{i = 0}^{M - 1} {\sum\nolimits_{j = 0}^{N - 1} {\beta_{c} \beta_{t} D_{ct} \cos \frac{{\pi \left( {2i + 1} \right)c}}{2M}\cos \frac{{\pi \left( {2j + 1} \right)t }}{2N}      \left\{ {\begin{array}{*{20}c} {0 \le c \le M - 1} \\ {0 \le t \le N - 1} \\ \end{array} } \right.} } $$
(2)
Where
$$ \beta_{c} = \left\{ {\begin{array}{*{20}l} {\frac{1}{\sqrt M },} \hfill & {c = 0} \hfill \\ {\sqrt {\frac{2}{M}} ,} \hfill & {0 \le c \le M - 1} \hfill \\ \end{array} } \right.\,\,\,\,\,\beta_{t} = \left\{ {\begin{array}{*{20}l} {\frac{1}{\sqrt N },} \hfill & {t = 0} \hfill \\ {\sqrt {\frac{2}{N}} ,} \hfill & {0 \le t \le N - 1} \hfill \\ \end{array} } \right. $$

Authors [24] proposed a lossy image compression technique based on DCT, in which an image is divided bases of frequencies, where the low frequencies are discarded. The authors applied proposed technique on various images like pepper image with quantization. Landge et al. [15] proposed a comparison technique based on DCT, in which only grayscale images of different sizes (256 × 256, 64 × 64 and 8 × 8) were taken. Their method achieved compressed image less in size than the original one. In this work, they used the MATLABXILINX-MATLAB methodology for their proposed compression technique. The reconstruction was done by using inverse of DCT to get the original image. Uma et al. [32] used the DCT method for the 2-D grayscale image to increase the storage space for saving more images at a time. They used VLSI architecture for parallel computation of images with the DCT and report satisfactory results. The authors mentioned that DCT is a moderate and best technique for image compression in terms of parallel programming.

3 Proposed Methodology

Our presented method, i.e. ZDD, compresses images with losses to save storage space as well as to transfer image files.

For better understanding, encoding block diagram is shown in Fig. 3 and decoding block diagram is presented in Fig. 4. It is obvious from Fig. 3, Discrete Wavelet Transform (DWT) is applied on the input image to decompose an image into four equal parts on basis of their frequency sub-bands. The four-equal frequency sub-bands consist of high-high (HH), high-low (HL), low-high (LH) and low-low (LL). These four images are then saved into a folder with their names as LL, LH, HL, HH gained through DWT. In the next step, each frequency sub-bands decomposed into four chunks, for example sub-band LL is divided into zone low low 1 (ZLL1), zone low low 2 (ZLL2), zone low low 3 (ZLL3), and low low 4 (ZLL4) respectively as shown in Fig. 3. Similarly, remaining three sub-bands are divided into four zones each. Then, DCT 2D were applied to each zone, as we had 2D images, therefore we applied DCT 2D instead of 1D. A similar mechanism is being applied for the rest of all 3 frequency sub-bands. Finally, each sub-band zones are passed to DCT 2D to combine the output in the form of a compressed image. In order to decompose the compressed bits initially, IDCT technique was applied on bits stream of the zone. After this, we had sixteen bits stream exists in the form of four, four zones i.e., ZLL1, ZLL2 … ZHH4 (see Fig. 4). To get back the four bands from the zone layer, every four parts of zones are combined. For example to construct sub-band LL zone (ZLL1, ZLL2, ZLL3, ZLL4) were combined, for reconstruction of LH sub-band zone (ZLH1, ZLH2, ZLH3, ZLH4) were merged. Similar combinations are made for the construction of HL and LH sub-bands. Lastly, the inverse of DWT operation is applied on four sub-bands to obtain the final decomposed image.
../images/485150_1_En_62_Chapter/485150_1_En_62_Fig3_HTML.png
Fig. 3.

Encoding framework of proposed work

../images/485150_1_En_62_Chapter/485150_1_En_62_Fig4_HTML.png
Fig. 4.

Decoding framework of proposed work

../images/485150_1_En_62_Chapter/485150_1_En_62_Figa_HTML.png

4 Experimental Results and Discussions

Our proposed methodology consists of two parts. First, Encoding is used to reduce the bandwidth for quick transfer of data. Second, Decoding is the inverse process of encoding. The encoding and decoding of the ZDD method is implemented by the algorithm as presented in the previous section.

In this section, we presented the effectiveness of our proposed ZDD methodology results for lossy image compression. We used real-world images for experimental purpose as shown in Table 1. All the results are compared with the standard state of the art of previous techniques such as JPEG, JPEG 2000 and HDR photos. The fundamental concept of JPEG technique was to eliminate the unnecessary information from an image. Generally, in JPEG compression, the visual appearance of an image can be seen different from its original image. However, it does not lose any useful information. Moreover, a tradeoff exists between the quality of image and storage size. Second, JPEG2000 is used to compare results with the ZDD method. This technique was developed on the basis of JPEG, and the aim of JPEG2000 was to obtain more accurate compression. The comparisons were made on the state-of-the-art images used in JPEG, JPEG 2000 and HDR photos to ensure the consistency of results. Our methodology (ZDD) showed competitive results with well-known JPEG, JPEG2000 and HDR Photos. Quantitative comparisons were made for the analysis by using PSNR values and can be computed by Eq. 3. PSNR refers to Peak Signals to Noise Ratio, precisely it depicts the quality of regenerated compressed matrix with respect to the original images. Thus, Mean Square Error (MSE), as computed by Eq. 4, is the total squared error between the input image and the compressed image while PSNR measures the peak error
Table 1.

Represents the comparative evaluation of the ZDD method with existing methods

Image

Method

JPEG PSNR

JPEG 2000 PSNR

HD photo PSNR

ZDD method PSNR

big_building.jpg

34.7226

25.266

21.7518

34.5036584

Big_tree.jpg

32.166

34.839

27.2198

34.6955269

bridge.jpg

32.1607

34.452

26.2629

32.5471716

Cathedral.jpg

34.3605

33.218

28.2349

37.7619170

Deer.jpg

31.7454

47.1979

36.6806

36.0143370

Fireworks.jpg

40.7422

37.1857

32.4577

40.3344634

Floer_foveon.jpg

37.8429

35.4603

29.1615

35.6577277

hdr.jpg

39.6114

39.0162

34.7

35.8046278

leaves_iso_200

35.6442

26.9464

22.6741

33.7354433

leaves_iso_1600

35.3111

39.0855

31.6836

33.6628123

Nightshot_iso_100

40.4402

40.4049

34.959

36.4697993

Nightshot_iso_160

35.1703

41.9129

38.2821

36.9412316

Spider_web.jpg

36.1093

35.1134

28.691

33.4924241

Zartificial.jpg

39.3692

23.2222

20.7011

34.1076934

Zone_plate.jpg

36.4246

42.4073

39.8255

35.1559657

$$ PSNR = 10\log_{10} \frac{{r^{2} }}{MSE} $$
(3)
$$ MSE = Sum \left( {I_{1} \left( {m,n} \right) - I_{2} \left( {m,n} \right)} \right)^{2} $$
(4)
In Eq. 4 while calculating MSE, I1(m, n) is the matrix to represent the original image, I2(m, n) represents a compressed matrix, m and n describe the dimensions of image and r in Eq. 3 depicts the maximum value of the matrix image. The detailed PSNR values for compression ratio 20:1 of ZDD method is mentioned in Table 1 along with other proposed techniques (JPEG, JPEG2000, and HD) with respect to PSNR values. In comparison with JPEG 2000, results were improved on 9 images out of 15 tested images as shown in Table 1. However, the results of 7 images out of 15 images by ZDD are found better than JPEG. For visual results, we compared the compressed image with the original image as shown in Fig. 5. We have compared our work with existing methods and gained better results as that of previous ones on the basis of PSNR values. The PSNR values and visual results clearly show that our method performed better than existing methods.
../images/485150_1_En_62_Chapter/485150_1_En_62_Fig5_HTML.png
Fig. 5.

(a). Original Image (b). ZDD method compressed image

5 Conclusion

In this research paper, new lossy image compression technique, named as ZDD is presented. ZDD compresses the images with an objective to reduce the image size for transmission of lossy images. ZDD is composed of DWT and DCT for image compression. DWT based bands are divided into zones to get the deep knowledge of pixels. Each band of DWT is decomposed into zones and then passed to DCT by combining all zones into a compressed image. After compressing input images, image is decompressed by using IDCT, applied on zone bitstream. Zones bit streams were merged in order to get the four DWT sub-bands (LL, LH, HL and HH). These frequency sub-bands are then transformed into a single by using IDWT. Experimental results of ZDD performed better and competitive to existing technologies such as JPEG, JPEG2000 and HD photos. However, DWT describes the frequency and spatial picture of an image with low energy on lower frequency sub-bands and edges and texture on high-frequency sub-bands. Therefore, we intend to consider edges and texture at high sub-bands including energy concentrated on lower sub-bands of images for better image compression.

Acknowledgment

This paper is supported by National Natural Science Fund NSF: 61272033 & 61572222.