You are on page 1of 5

A Modified Three Level Block Truncation Coding For Image Compression

D. Anil
Dept of ECE NIT Warangal, Warangal, Andhra Pradesh, India anil.boon2007@gmail.com

K. V. Karthik
Dept of ECE NIT Warangal, Warangal, Andhra Pradesh, India karthik.kv90@ieee.org

K. Sudhir Kumar
Dept of ECE NIT Warangal, Warangal, Andhra Pradesh, India sudhirnitw08@gmail.com
AbstractBlock Truncation Coding (BTC) is a lossy data compression technique used for compression of images. BTC is a simple and fast image compression algorithm with less computational complexity than former schemes proposed. In this paper we propose a modified three-level BTC with an improved compression factor. Experimental results show that the suggested image compression methodology yields an image with better quality, low bit rate and lower computational complexity than the conventional three-level BTC. Keywords- Block Truncation Coding, AMBTC, Image Compression, bit rate, bit plane, PSNR, MSE.

1) Lena

(2) Cameraman

I.

INTRODUCTION

Images serve as the pinnacle of information in various areas today. And hence, the need to share the information has also grown. In such conditions, the necessity for the data to be stored in the least possible space, preserving its quality at the same time has become a challenging task. This has given rise to various data compression techniques, which in case of images is known as image compression. Image compression techniques are broadly classified into two major categories namely, Lossless Image Compression and Lossy Image Compression. Lossless Image Compression gives less compression ratio but gives good quality of compressed images. Lossy Compression gives a higher compression ratio. Block Truncation Coding (BTC) is one of the lossy compression techniques based on the conservation of statistical properties and has been observed as an efficient method for image compression [1]. The conventional three-level BTC is just an extension of BTC, the first stage being that of basic BTC, the second stage being that of classification and the third stage being that of matching [3], [4]. In this paper, we put forward a method that makes use of one bit to express the result of quantising pi unlike the two bits used in the conventional

(3)

Einstein

(4)

Peppers

(5)

Ship

(6)

Penguins

(7)

Jet

Fig. 1 Standard Images used for the experiment

Table I Row Sequence and Pixel Values for decoding phase of the proposed methodology

Row Sequence 0000 0001 0010 0100 1000 0011 0110 1100 0101 1010 1001 0111 1011 1101 1110 1111

xi

xi +1

xi + 2

xi + 3

xL xL xL xL
xH

xL xL xM xM xM xM xM xM xM xM xM xM xM xM
xH xH

xL xM xM xM xL xM xM xM xM xM xM
xH

xL
xH

xL xL xL
xH

1) Lena

(2) Cameraman

xL xL
xH

xL xL
xH

(3)

Einstein

(4)

Peppers

xL
xH xH

xL
xH xH xH xH (5) Ship (6) Penguins

xL
xH xH xH xH

xM xM xM
xH

xL
xH (7) Jet
Fig. 2 Standard images compressed using conventional Three-level BTC

three-level BTC. The mean xH of higher range and xL of lower range have been calculated for each block as proposed in AMBTC [2], [5]. We have introduced the mean xM of the medium range in this method which is the average of the mean of the higher range and the mean of the lower range and is utilized during the reconstruction of the image. In the decoder phase, the image block is reconstructed by replacing `1`s and `0`s with xH , xM and xL according to the sequence of `1`s and `0`s in the row of each corresponding image block. The performance of any image compression technique is evaluated in terms of MSE and PSNR [6]. MSE stands for Mean Square Error and is defined as the cumulative squared error between the compressed and the original image. It is given by 1 X Y MSE = (1) [ I ( x, y ) I '( x, y)]2 XY x =1 y =1 PSNR stands for Peak Signal to Noise Ratio and is defined

as the measure of the peak error. It thus represents the quality of the reconstructed image. It is given by [3] (2n 1) 2 PSNR = 10 log10 (2) MSE Experimental results convey that the proposed methodology yields an image of very good quality with low computational complexity and also a lower bit rate. The comparison can be seen very distinctly in Fig. 1, Fig. 2 and Fig. 3. We have briefly outlined the Conventional ThreeLevel Block Truncation Coding in Section 2. Section 3 describes the proposed image compression scheme. The experimental results have been discussed with regard to various terminologies in Section 4 and the paper has been concluded with Section 5. II. CONVENTIONAL THREE-LEVEL BLOCK TRUNCATION
CODING

In this method the entire image is divided into nonoverlapping blocks. The first stage of Three-level Block Truncation Coding (BTC) is a basic BTC yielding a binary

1) Lena

(2) Cameraman

(3)

Einstein

(4)

Peppers

Fig. 4 Bit plane of Lena generated by proposed three level BTC

quantizing pi is expressed using two bits. Hence, 32 bits are used to express the result of quantizing pi of an image block (5) Ship (6) Penguins of 16 bits. xL and xH , each is represented by 8 bits. Thus, the total number of bits used to represent an image block is 8+8+32=48bits. Three-level BTC uses two bits per pixel, thereby reducing the compression factor. Compression factor (CF) for this method is defined as bn (6) CF = 2n + 2b where b stands for the number of bits used to represent the pixel and n stands for the size of the image block. The value of b for this method is 8 and if n is 16, it results in the compression factor (CF) being 2.67and bit rate 3bits per pixel. Bit plane of the image is generated by comparing the values of the pixels with its corresponding mean ( x ) of the block. III. PROPOSED METHODOLOGY The proposed methodology for BTC gives more compression ratio as well as very less PSNR when compared to the conventional three-level BTC. The proposed algorithm is very much similar to AMBTC, the only difference being in the decoding phase. AMBTC divides the pixel into nonoverlapping blocks, preserving the higher and lower mean of the block [2]. Pixels in the corresponding block are then classified into two ranges of values, taking the average gray level of the pixels as the reference-the upper range being the values greater than or equal and the lower range being the values less than the average gray level. The higher mean xH and the lower mean xL are calculated as

(7)

Jet

Fig. 3 Standard images compressed using proposed three-level BTC

matrix and two numbers. The second stage classifies the binary matrix into either a block that has no edges, or a block with a single edge or a block with a pair of edges. Depending on the classification, the classified blocks of pixels are matched to a particular model [4]. It quantizes each pixel pi into one of three values ( xH , xM and xL ), rather than two.

xH , xM and xL are defined as: (5* max( pi ) + min( pi )) (3) xH = 6 where i=1, 2, 3....., 16. (max( pi ) + 5* min( pi )) (4) xL = 6 (max( pi ) + min( pi )) xM = (5) 2 A pixel pi is compared with xH , xM and xL and is quantized to the nearest of these values. The result of

Table II. Comparison of various parameters for both methods

Test Image Lena Cameraman Einstein Peppers Ship Penguins Jet

Conventional Three-Level BTC MSE 195.2842 184.6423 151.8914 281.4737 106.3163 206.5278 144.0848 PSNR 25.2241 25.4675 26.3155 23.6364 27.8648 24.9801 26.5446 2.67 181.4601
xH = xL = 1 xi k xi x
n

Proposed Three-Level BTC BIT RATE 3 3 3 3 3 3 3 37.2363 3 2. 32.4211 MSE 118.454 53.9057 103.6482 189.6803 33.5151 63.2053 PSNR 27.3953 30.8145 27.9752 25.3506 32.8784 30.1233 CF 4 4 4 4 4 4 4 BIT RATE 2 2 2 2 2 2 2

CF 2.67 2.67 2.67 2.67 2.67 2.67 2.67

Average 25.7190

4 2 85.6636 29.5655 The values of the pixel in the middle, i.e. xi +1 and

(7)

1 n (8) xi n k xi < x where k stands for the number of pixels with gray level greater than or equal to the gray level average x . As per AMBTC, the bit plane generation is carried out by a two level quantization such that all the pixel values greater than the gray level average are replaced by 1 whereas those with the values less than the gray level average are replaced by 0 [5]. In the decoding part, the image block is reconstructed by replacing the 1s by xH and the 0s by

xi + 2 are determined according to the sequence of the row. For example, consider the row sequence 0101. Since the values of the first and the last pixels in the row sequence are 0 and 1 respectively, the corresponding values of the pixel xi is 0, xi +1 is 1 and that of xi + 2 is 0, xi +1 is more

likely to take the value xM than xH as the value of the xi takes the value xM than xH . Since the value of the xi +1 is 1, that of xi + 2 is 0 and xi + 3 is 1, xi + 2 is more likely to take the value xM than xL . The entire table has been constructed in a similar fashion. Compression factor (CF) for this method is the same as that defined for the BTC technique and is given by bn (10) CF = n + 2b where b stands for the number of bits used to represent the pixel and n stands for the size of the image block. Hence, this method yields a better Compression Factor than the conventional three-level BTC. IV. RESULTS The performance of the proposed compression technique been evaluated on various standard images. The standard images used for experimentation have been shown in Fig. 1. Fig. 2 and Fig. 3. represent the images compressed using the conventional three-level BTC and the proposed three-level BTC respectively. The experiment scheme and the archetype BTC algorithm has been shown. The experiments

xL . The only excess term calculated in the proposed methodology is the mean of the higher mean and the lower mean, xM which is given by,
xH + xL (9) 2 Unlike the above described AMBTC algorithm, the proposed algorithm uses the above Table I for the decoding phase. The table has been constructed using a very simple methodology. The pixel value xi represents the value of the xM =
pixel at the i position, xi +1 for the (i + 1) and so on. The table has been constructed using these steps: 1. The values of the pixel in the extremes, i.e. xi and
xi + 3 take the values xL and xH when 0 and 1 in the row sequence respectively.
th

300 250 200 150 100 50 0


Lena Cameraman Einstein Peppers Ship Penguins Jet Average

MSE (Conventional Three Level BTC) MSE (Proposed Three Level BTC)

Fig. 5 Comparison of MSE of both methods

35 30 25 20 15 10 5 0
Lena Cameraman Einstein Peppers Ship Penguins Jet Average

Mean Square Error is a very important metric in the evaluation of the performance of a compression technique. Lesser the MSE, better is the compression method. The proposed method has been able to achieve very less MSE, as shown in the table. The average of MSE of all the images for the conventional three-level BTC is 181.4601 which is far greater than that of the proposed three-level BTC. Another error metric used to evaluate the performance of the compression methods is the PSNR. PSNR has an inverse relation with the MSE. Hence, higher the PSNR, more is the efficiency of the compression method. Higher the PSNR, lesser is the noise in the decoding and better is the quality of the compressed image. As shown in the table, the average value of PSNR of all the images for the proposed three-level BTC is greater than that of the conventional three-level BTC. Fig. 5 and Fig. 6 show the graphical comparison of error metrics, MSE and PSNR for both, conventional three-level BTC and the proposed three-level BTC. As evident from the graph, MSE for the former method is much higher than that for the latter. As per the graph, the PSNR values of the proposed methodology exceed the values of the conventional method. V. CONCLUSIONS A modified three-level BTC image compression methodology has been proposed in this paper which is aimed at giving better image quality, lower computational complexity, better compression factor, lower bit rate, improved PSNR and lower MSE. Also, the images obtained as a result of the proposed method have been observed to occupy lesser space. The lower computational complexity of this method makes it very much apt for use in low power devices such as mobile phones, etc. REFERENCES
[1] E. J. Delp, O. R. Mitchell, Image Compression using Block Truncation Coding , IEEE Trans. On Communications, Vol. 27, pp.1335-1342, September 1979. M. D. Lema, and O. R. Mitchell, Absolute Moment Block Truncation Coding and its Application to Color Images, IEEE Trans. On Communications, Vol. 32, pp. 1148-1157, 1984. Wen-Jan CHEN, Shen-Chuan TAI, A Genetic Algorithm Approach to Multilevel Block Truncation Coding, IEICE Trans. Fundamentals, Vol. E82-A, No. 8, August 1999. David Salomon and Giovanni Motta, Handbook of Data Compression, 5th ed, Springer- Verlag, 2010. K. Somasundaram, I. Kaspar Raj, An Image compression Scheme based on Predictive and Interpolative Absolute Moment Block Truncation Coding, GVIP Journal, Volume 6, Issue 4, December 2006. K. Somasundaram et. Al., Efficient Block Truncation Coding, International Journal on Computer Science and Engineering,, Volume 02, No. 06,2163-2166, 2010.

PSNR (Conventional Three-Level BTC) PSNR (Proposed Three-Level BTC)

[2]

Fig. 6 Comparison of PSNR of both methods

were carried out using Matlab R2010a on Windows Operating System on a hardware using Intel Core 2 T5750 Duo operating at 2.00GHz on 2GB RAM. Table 2 shows the comparison of the results obtained for the various test images when compressed using conventional three-level BTC and the proposed threelevelBTC. The parameters used for the comparison of the results of both the methods are Mean Square Error (MSE), Peak Signal to Noise Ratio (PSNR), Compression Factor (CF) and Bit rate. It is very much evident from the figures given in the table that the compression factor for the conventional three-level BTC is very much low when compared to that of proposed methodology. The higher the compression factor more is the compression of the image. The bit rate of the proposed algorithm is lesser than that of the conventional BTC. Lesser is bit rate, lesser is the space occupied by the compressed image.

[3]

[4] [5]

[6]

You might also like