Image Compression Algorithms Using Intensity Based Adaptive Quantization Coding

: Problem statement: Low complexity image compression algorithms are necessary for modern portable devices such as mobile phones, wireless sensor networks and high constraint power consumption devices. In such applications low bit rate along with an acceptable image quality are an essential requirements. Approach: This study proposes low and moderate complexity algorithms for colour image compression. Two algorithms will be presented; the first one is intensity based adaptive quantization coding, while the second is a combination of discrete wavelet transforms and the intensity based adaptive quantization coding algorithm. Adaptive quantization coding produces a good Peak Signal to Noise Ratio (PSNR), but with high bit rates compared with other low complex algorithms. The presented algorithms produce low bit rate whilst preserving the PSNR and image quality at an acceptable range. Results: Experiments were performed using different kinds of standard colour images, a multi level quantizer, different thresholds, different block sizes and different wavelet filters. Both algorithms considered the intensity variation of each colour plane. At high compression ratios the proposed algorithms produced 1-3 bpp bit rate reduction against the stand alone adaptive quantization coding for the same image quality. This reduction was achieved due to dropping of some blocks that claimed to be low intensity variation according to a comparison with predefined thresholds for each colour plane. The results show that the bit rate can be reduced by 72-88% for each low variation image block from the original bit rate. Conclusion: The results obtained show a good reduction in bit rate with the same PSNR, or a slightly less than PSNR of a standalone adaptive quantization coding algorithm. Further bit rate reduction has been achieved by decomposing the input image using different wavelet filters and intensity based adaptive quantization coding. The proposed algorithm comprises a number of parameters to control the performance of the compressed images.


INTRODUCTION
Image compression can be classified into lossy and lossless. The lossy type aims to reduce the bits required for storing or transmitting an image without considering the image resolution much. The lossless type focuses on preserving the quality of the compressed image so that it is exactly the same as the original one.
Many algorithms have been developed by researchers for both image compression types; some of these algorithms use Discrete Cosine Transform (DCT) or Discrete Wavelet Transform (DWT), while others avoid the complexity of applying such transformation. As an example of transformation dependent algorithms we can consider the joint photographic experts group image coding standard, JPEG and JPEG2000. JPEG is the most common global standard of image compression and uses DCT, while JPEG2000 uses DWT. The main problem with JPEG and JPEG2000 is their unsuitability for small devices that require low power consumption and higher processing speed. Different approaches have been proposed for image compression using DWT, such as the adaptive algorithm for scalable wavelet image coding (Yuk-Fan et al., 2008). This algorithm was based on the regularity and features of images. It can be embedded in the wavelet based image coding system.
The other type of compression algorithms does not use a DCT or DWT. A typical example of such algorithms is Block Truncation Coding (BTC), which was implemented by (Delp and Mitchell, 1979). This algorithm is used for grey-scale image compression with a bit rate of two bpp and a good PSNR. The algorithm divides the image into (4×4) blocks to compute a bit plane using a two level quantizer and two moments representing the high and low mean. The main drawback of this algorithm is its high bit rate. However, it is an attractive option due to its simplicity and high image quality (Oshri et al., 1993).
Many researchers have tried to modify or enhance the response and reduce the bit rate of BTC (Domnic, 2006). Some of these algorithms use the same two level quantizer, while others use a three-level quantizer (Wang et al., 2009a;Oshri et al., 1993).
In (Oshri et al., 1993), the authors used a three level quantizer to classify the pixels into low, intermediate and high intensity, according to a predefined threshold. To further reduce the bit rate, this algorithm transmitted only an odd row and odd column of each (6×8) block; the other pixels were reconstructed according to the Laplacian interpolation function.
In (Wang et al., 2009a), an algorithm for colour image compression was presented. It was a combination of ordinary BTC and adaptive quantization coding AQC (Wang et al., 2007). The algorithm presented in (Wang et al., 2009a) transformed the RGB image to luminance-chrominance colour space (YCbCr) and portioned it into (6×6) main blocks, each block being divided into (3×3) sub-blocks. The sub-blocks were encoded using the BTC algorithm to extract four luminance bit planes and 24 moments (two moments for each colour plane of each block). These components were encoded using the AQC algorithm, which will be explained in more detail in the next section.
An algorithm for colour image compression was presented in (Wang et al., 2009b). This algorithm generated a luminance bit map to represent the edge information, with three additional bits to represent the differences between luminance (Y) and the three channel colors.
The blocking artifact that was introduced using a conventional BTC was reduced by diffusing the quantized error into neighboring pixels. This algorithm was implemented by (Guo, 2008) and was a combination of an ordinary BTC and modified Error Diffusion (EDF). Finally, an improved and less complex BTC algorithm was presented using a Look Up Table (LUT) dither array. This algorithm was named ordered dither BTC (ODBTC) by (Guo and Wu, 2009).
The current study introduces two intensity based adaptive quantization coding for colour image compression. The first model takes into consideration the different intensity variation of image regions to reduce the bit budget for the compressed image. The second computes the intensity based AQC algorithm parameters of the one level decomposed image. The input image is decomposed using different wavelet filters to further reduce the bit rate. Additionally, the proposed algorithms provide bit rate and PSNR control for better performance.
The rest of the study is organized as follows. First an explanation of the AQC algorithm is given. Intensity based proposed algorithms are introduced. Samples of the results obtained are also listed. Finally, conclusions are given.

MATERIALS AND METHODS
Adaptive Quantization Coding (AQC): AQC is used in different applications as a low complex and high speed image compression system. Different approaches of AQC and BTC have been suggested for use as an image compressor for overdrive of motion blur reduction in a Liquid Crystal Display (LCD) (Wang and Chong, 2009;Wang et al., 2009a;Han et al., 2008;Wang et al., 2007;Wang and Chong, 2010). The computation steps of the AQC compression algorithm can be briefly described as follows: • Segregate the image into non-overlapped blocks of (m×n) pixels • The quantizer step can be computed using Eq.1: where, Q s represents the quantization step, Q L is the number of quantization levels B m = Max(B( x,y )) and B m = Min (B( x,y )) where B( x,y ) is a block with (m×n) pixels and B(x,y)∈I in (1:n:R x ,1:m:C x ,1:Z x )l in represents the intensity values of the input image and R x ,C x and Z x is the size of the input image.
• The bit plane (B p ) of each block using a multi-level quantizer can be figured according to Eq. 2: The encoded bit stream includes a bit plane, quantizer step and the minimum of each block. According to the previous description, the resultant bit rate in bits per pixel of a grey scale image can be computed using Eq. 3: where, Bit s is the bits required for the quantizer step and Bitn is the bits used for encoding the minimum of each block (typically 8 bits). As an example, in the case of a grey scale image with (512×512) pixels with a block of (4×4) pixels, the resultant bit rate will be 3.8125 bpp for an 8 level quantizer .
This algorithm outperformed the BTC algorithm from a performance and quality point of view, but had a higher bit rate than the BTC algorithm (Wang et al., 2009a).
Proposed algorithms: We will present two intensity based adaptive quantization coding for colour image compression. The proposed algorithms aim to reduce the high bit rate of the adaptive quantization 3 coding, whilst keeping the quality of the compressed image at an acceptable level. The first algorithm is intensity based adaptive quantization. The algorithm has been named IBAQC, while the second is a combination of DWT and an IBAQC algorithm.

Intensity Based Adaptive Quantization Coding (IBAQC):
This algorithm is a composition of AQC units and an additional unit, with the aim of checking the intensity variation of each image block, as shown in Fig. 1. The proposed algorithm classifies each image block into one of two classes, low or high intensity variation. The high intensity variation block was encoded using an AQC coding system while the others were represented by the minimum of each block.
The input image was first divided into nonoverlapped block (m × n) pixels. For each block the difference between the maximum, minimum and quantizer step was computed for the specific quantizer that had been selected. The quantizer was selected according to the target bit rate and PSNR; for high PSNR the number of quantization levels should be selected to give a good conciliation between PSNR and bit rate.
The low variation blocks required lower quantization steps compared with the high variation or edge blocks. To exploit this attribute for bit rate reduction we compared the quantization step with a predefined threshold.
The bit plane and quantization step bits of any block where the quantization step was less than the threshold were discarded and only the minimum intensity value of the block was encoded. The information consisting of bit plane and quantizer step size and the minimum intensity value of other blocks, were transferred to compose the encoded bit stream. The process can be described in Eq. 4: where, L q and L q-1 are any two successive quantization levels in the block q∈{2, log 2 Q L }, {..} is a set of parameters and the flag Ρ⊂{0,1}and δis an adjustable parameter which represents a threshold; it is a set of thresholds for each colour {R t ,G t ,B t } . The encoded bit stream for low and high variation blocks for different quantization levels is shown in Table 1.
The bit required for the quantization step was computed using Eq. 5: where, [:] represents ceil function, while the number of bits required for the bit plane of high variation blocks was computed accoriding to Eq. 6: Then the bit rate of the proposed algorithm for each image block was obtained using Eq.7 : where, Bit n is the bit required for encoding the minimum of each block.
It is clear from Table 1 that for this case the bit rate can be reduced by a rate of 72-88% from the original bit rate for the low variation blocks. This will reduce the bit rate but is less effective in reducing PSNR for an image that contains much unchangeable scenes or low deviation areas. The threshold was predefined for each colour plane, taking into consideration that the green band is the most informative band, thus its threshold was kept lower than the other two channels to achieve good performance. The best results can be achieved by better tolerance of the quantizer size and thresholds.
On the decoder side, the decoder is sensitive to the flag bit. If it is in high state, the block is classified and decoded as a low variation block; otherwise it is decoded as a high variation block.
The decoding process can be represented by Eq. 8: where, I decod is the decompressed image.

Intensity based adaptive quantization coding using DWT (DWT-IBAQC):
The proposed algorithm presented in section III-A was used to encode the coarse coefficients of DWT. This algorithm was named the DWT-IBAQC algorithm, as shown in Fig. 2. The input RGB colour image was first decomposed using different types of wavelet filter. The decomposition and down sampling process for a 1D-input signal can be expressed by Eq. 9 and Eq. 10: where, Ψ High and Ψ low are the high and low output coefficients respectively, H and L are the high and low wavelet filter coefficients respectively and Φ (k)is a 1-D input signal.  The 2D wavelet decomposition can be computed by applying 6 and 7 successively to each row and column. The wavelet filters used were chosen from different wavelet families according to complexity, the number of vanishing moments and other features that are shown in Table 2 (Daubechies, 1994). The main advantage of the wavelet filters is they compact the energy of the whole image into a few coefficients. As the rate of energy compaction increased a good performance was achieved. The effect of these filters on the objective fidelity criteria and the subjective quality of the output images was studied.
The decomposition was kept fixed at one level, as shown in Fig. 3, to preserve the low complexity of the compression system as much as possible.
The coarse (Low pass) wavelet coefficients were partitioned into (4×4) pixels. The parameters of each block were computed and then classified into high or low intensity variation blocks, by comparing the quantization step with a predefined threshold.
The other coefficients of fine components were discarded in order to further reduce the bit rate because most of the image energy was compacted into the low pass coefficients. The degree of energy compaction was approximately the same for all wavelet filters that were used in this research, except for the simplest Haar filter which had low vanishing moments.
The resultant bit rate was lower than that achieved using the IBAQC algorithm, but with a tiny reduction of PSNR in some cases. The other steps of computation of the whole bit pattern of the image under processing were the same as for the IBAQC algorithm.
Three factors should be considered for these algorithms. Firstly processing time, which depends on block size, with or without wavelet and the type of wavelet filter. Increasing block size reduces the processing time, while using a wavelet filter increases time, performance and complexity. The second and third factors are bitrates and PSNR, which are varied according to the type of application that the compression algorithm is designed for.

RESULTS AND DISCUSSION
Simulation results: The performance of the two proposed algorithms was assessed using objective and subjective fidelity criteria on several test images. A discussion on a sample of the results acquired will be presented in the following two sub-sections.
Objective tests: Two objective tests have been used in our experiments to evaluate the performance of the proposed algorithms. The first one was S-CIELAB (International Commission on Illumination) (Zhang and Wandell, 1996) and (Zhang et al., 1997). While the second test is the Peak Signal to Noise Ratio (PSNR) which can be computed using Eq. 11 (Koh et al., 2003): 2 10 P,Q,3 2 in (i, j,k ) decod (i, j,k ) i, j,k 255 3PQ PSNR 10 log (l l ) where, I decod is the decompressed image, P and Q are the dimensions of the image, I =1 ... P, =1...Q and k=1,2,3.
The tests were evaluated using 2, 4, 8 and 16 quantization levels. Some of the parameters, such as block sizes, thresholds and the number of quantization levels, are shown underneath each figure. Figure 4 shows PSNR, bit rate and S-CIELAB error of the AQC algorithm for the Lena colour image compression using different block sizes and quantization levels. S-CIELAB error shown in Fig. 4 has been computed for the error that exceeds 20 for gamma correction factor of 2.2. From this figure one can notice that the best choice for higher PSNR was (4×4) block size and 8 quantizer level, while for the best compromises between bit rate and PSNR the best choice was (4×4) and (8×8) block sizes, with 2 and 4 quantizer levels, respectively. The worst cases were obtained when the block dimensions were (16×16), regardless of the number of quantization levels.
The results obtained using the IBAQC algorithm for the Lena image are shown in Fig. 5. The same image was compressed using different thresholds and different wavelet filters, as shown in Fig. 6. The results obtained by daub, coif and bior 9/7 are close to each other. This is because the first two filters (daub and coif) have a high number of vanishing moments, while the third filter (bior 9/7) is symmetrical and has a linear phase property. Thus, the symmetry of the bior 9/7 filter is recommended for the best compromise between complexity and performance, while the Haar filter (the simplest filter) introduced low performance due to its non-linear phase property (Qiu and Dervai, 2000). The results shown in this figure show that for a lower bit rate (1 bpp) the best block size and quantization level were (4×4) pixels and 4 levels, respectively. Table 3 illustrated the S-CIELAB measure for the selected wavelet filters with Gamma factor 2.2. These outcomes represent the number of pixels when the error exceeds 20. Furthermore, the table shows that 0.2% from the original number of pixels (512×512) in DWT-IBAQC algorithm produced an error more than 20.
As can be noticed from the previous figures, for lower bit rates the IBAQC and DWT-IBAQC algorithms both outperform the AQC algorithm. An example of this is the case of 26 dB PSNR, where the results obtained using AQC, IBAQC and DWT-IBAQC were 6.2 bpp, 2.6 and 1 bpp, respectively. For some higher bit rates the PSNR of the AQC algorithm was higher than the proposed algorithms.
The results of the proposed algorithms for the Tiffany image are shown in Table 4 and Fig. 7 for (4×4) block dimensions. Table 4 shows a relation between PSNR and bit rate, the number of quantization levels and different thresholding for R, G and B colour planes. It is also worth mentioning that some results in this table represent a good example of appropriate parameter tuning (QL, thresholds for R, G and B planes).
On the other hand, there are some results (Table 4 Bold face rows) represent examples of inappropriate parameter selection compared with the other results in the table. To explain this take the case of R t = 10, G t = 5, B t = 10 and Q L = 2, which produced 3.8 bpp with 28.1 dB. While by increasing the quantization levels to four with the same threshold values (R t , G t , B t ) the proposed algorithm was gave 3.4 bpp and 29.1 dB. This is an example of best compromises between PSNR and bit rate (i.e., lower bit rate with higher PSNR) (rows 3 and 4 in Table 4).
The performance of DWT-IBAQC is shown in Figures 6, 7 and 10 for Lena, Tiffany and Peppers colour images, respectively. These figures are for lower bit rates and the wavelet filters had approximately the same performance, while for higher bit rates the less complex and simple wavelet filter (Haar) produced lower performance by -2dB against the other filters.
The results obtained for the Peppers image using AQC, IBAQC and DWT-IBAQC algorithms are shown in Fig. 8-10, respectively. In Fig. 8 the last bar represents the worst case, which produced low PSNR with high bit rate.  Figure 11 shows the visual affects of standalone, intensity based AQC and DWT-IBAQC algorithms on the Lena colour image. Some blocking artefacts can be noticed for the Lena image (second row, first column) due to use of a large block size (16×16) with four quantization levels. While the same PSNR and better visual impression was obtained using the intensity based algorithm and the following controlling parameters: (4×4) block size and 4 quantizer levels with a threshold of 15, 10 and 15 for R, G and B colour planes, respectively.  Figure 12 demonstrates the Airplane image. It can be seen that the bit rates obtained ranged from 1.1 bpp to 6 bpp. The image compressed using AQC in this case acquired high bit rate, while the best compromise results between bit rate and PSNR from our point of view were obtained using the DWT-AQC algorithm using a Bior9/7 wavelet filter. The effect of wavelet filters used in the tests for this case was nearly the same but with slightly better performance in terms of PSNR.
The obtained results are computed on the original size of images (512×512×3) pixels. The output images have been cropped in Fig 11 and 12 to give better view about the blocking artifacts.
The blocking artifact is the main disadvantage of the algorithms at lower bit rates as can be noticed in Fig. 11 and 12. Furthermore, S-CIELAB histogram was computed and listed for Lena, Tiffany and airplane images, as shown in Fig. 13.

CONCLUSION
Two algorithms based on BTC and AQC algorithms have been introduced. These algorithms were implemented to reduce the bit rate produced by the AQC algorithm, whilst preserving image quality at an acceptable level. The first algorithm (IBAQC) computed the adaptive quantization attributes for the high intensity variation image blocks.
The results obtained showed a good reduction in bit rate with the same PSNR or a slightly less than PSNR acquired using the AQC algorithm. In the second algorithm we merged the energy compacting attribute of DWT with the IBAQC algorithm (DWT-IBAQC) for further reduction of bit rate. A different type of wavelet filter also produced a slight improvement in PSNR with the same or approximately the same bit rate. For higher bit rate the PSNR attained by AQC was equal or slightly higher than that obtained by the IBAQC algorithm.
Finally, the proposed algorithms introduced flexibility in rate-distortion control by adjusting the input parameters, such as block size, number of quantization levels and thresholds.