Abstract— the present work investigates image compression. Two algorithms were selected namely; block truncation coding (BTC) and Absolute Moment block truncation coding (AMBTC) and a comparative study was performed. The Block Truncation Coding (BTC), Absolute Moment block truncation coding (AMBTC) are the lossy image compression algorithms. These are simple and easy to implement image compression algorithms. The basic BTC and AMBTC algorithm is a lossy fixed length compression method that uses a Q level quantizer to quantize a given region of the image. Both of two techniques rely on applying divided image into non overlapping blocks. They differ in the way of selecting the quantization level in order to remove redundancy.
.
Index Terms— BTC, AMBTC, Q level quantizer, image
compression; mean, standard deviation
I. INTRODUCTION
Data Compression shrinks down a file so that it takes up less space. This is desirable for data storage and data communication. Storage space on disks is expensive so a file which occupies less disk space is "cheaper" than an uncompressed file. Smaller files are also desirable for data communication, because the smaller a file the faster it can be transferred. A compressed file appears to increase the speed of data transfer over an uncompressed file.
II. TYPES OF DATA COMPRESSION
There are two main types of data compression: lossy and lossless. Lossy data compression is named for what it does. After one applies lossy data compression to a message, the message can never be recovered exactly as it was before it was compressed. When the compressed message is decoded it does not give back the original message. Data has been lost. Because lossy compression can not be decoded to yield the exact original message, it is not a good method of compression for critical data, such as textual data. It is most useful for Digitally Sampled Analog Data (DSAD). DSAD consists mostly of sound, video, graphics, or picture files. Algorithms for lossy compression of DSAD vary, but many use a threshold level truncation. This means that a level is chosen past which all data is truncated. In a sound file, for example, the very high and low frequencies, which the human ear cannot hear, may be truncated from the file. Some
examples of lossy data compression algorithms are JPEG, MPEG, Lossless data compression is also named for what it does. In a lossless data compression file the original message
can be exactly decoded. Lossless data compression works by finding repeated patterns in a message and encoding those patterns in an efficient manner. For this reason, lossless data compression is also referred to as redundancy reduction. Becuase redundancy reduction is dependent on patterns in the message; it does not work well on random messages. Lossless data compression is ideal for text. Most of the algorithms for lossless compression are based on the LZ compression method developed by Lempel and Ziv.
III. Standard BTC Algorithm
Block Truncation Coding (BTC) works by dividing the image into small sub blocks of size 4 x 4 pixels and then reducing the number of gray levels within each block. This reduction is performed by a quantizer that adapts to the local image statistics. The basic form of BTC divides the whole image into N blocks and codes each block using a two-level quantizer. The two levels, a and b are selected using the mean ( X ) and standard deviation () of the gray levels within the block and are preserved. Each pixel value within the block is then compared with the mean and then is assigned to one of the two levels [1, 2]. The X and are calculated using the equations (1) and (2).
Where, m is the number of pixels in each block, and Xi is the original pixel value of the block. If the pixel value of each block is greater than or equal to mean, it is represented by “1‟ and if less than the mean, it is represented by “0”.The collection of 1s or 0s for each block is called a bit plane, B. In BTC, two Statistical moments a and bare computed using the equations (3) and (4) and are preserved along with the bit plane for reconstructing the image. The compressed image is transmitted or stored as a set {B, a, b}
Image compression using BTC and AMBTC
Where, q is the number of pixel values greater than or equal
to and (m-q) is the number of pixels whose gray levels are
less than While reconstructing the image, the 0 in the bit plane is replaced by a and the 1 in the bit plane is replaced by
b. The difference between the original image and reconstructed image is called Mean Square Error (MSE) and is calculated using the equation (5). The quality of the reconstructed image called the Peak Signal to Noise Ratio (PSNR) is calculated using the equation (6) and is the inverse of MSE.
Where, yi is the reconstructed pixel value, xi is the original pixel value and N is the number of pixels in an image.
The BTC algorithm involves the following steps:-
For compression:-
1. Input image 2. Set block size
3. Calculate vertical and horizontal blocks
4. Create matrix (1) for saving means, std of blocks. Binary matrix and comp
5. For each block
Calculate and save mean Calculate and save std.
Get binary matrix by comparing pixel value with mean
6. Compress binary matrix for mean and std. in above step(considering 8 binary value = 1 byte)
7. Save means, stds, compressed mat data.
For decompression:-
1) Load save d data
2) Decompress compressed matrix (1 byte = 8 binary values)
3) For each block in decompressed mat Extract block
Get mean and std of block
Calculate no. of ones in block (say 9) Calculate values of a and b
Replace 0 by a and 1 by b in block 4) Show decompressed mat.
An example is shown in following tables:
The original image block. The average gray level = 159
181 173 156 141
192 180 138 118
188 183 141 116
185 176 157 123
The encoded information: the binary block (16 bits),
. Total = 32 bits/block.
The reconstructed image block by the decoder.
The error (difference between the original and the reconstructed image block). Mean square error = 128.5.
-1 -9 20 5
10 -2 2 -18
6 1 5 -20
3 -6 21 -13
IV. ABSOLUTE MOMENT BLOCK TRUNCATION
Coding (AMBTC)
Lema and Mitchell presented a simple and fast variant of BTC named Absolute Moment Block Truncation Coding (AMBTC). In this method, the higher mean h x and lower mean l
x are preserved instead of the mean and standard
deviation values. Pixels in an image block are then classified into two groups of values. One group (higher range) comprising of gray levels which are greater than or equal to the mean ( x ) and the remaining gray levels are brought into another group (lower range). The mean h x of higher range1 1 0 0
1 1 0 0
1 1 0 0
1 1 0 0
182 182 136 136
122 182 136 136
182 182 136 136
Where, q is the number of pixels whose gray levels are greater than or equal to x. Then a two level quantization is performed for all the pixels in that block to form a bit plane of 1‟s and 0‟s. The encoder generates l x, h x and bit plane for each block, thus leading to 2 bpp like BTC. AMBTC involves less number of computations, when compared to BTC as standard deviation involves more multiplications. AMBTC yields high quality of reconstructed images. [2]
An example for AMBTC encoding procedures are shown in Figure 1. Figure 1 (a) shows an image block of 4×4 pixels. To encode this block, the mean of this block is calculate as o =225 . The value o is then taken as a threshold to generate a bit plane B, as shown in Figure 1(b). Pixels with values higher than or equal to o have a corresponding bit valued 1 stored in the bit plane. Otherwise, bit valued 0 is stored. Two rounded quantization levels a =223 and b = 226 can be calculated using Equations (1) and (2). Once the quantization levels and the bit plane have been calculated, the compressed code of this image blocks comes out as trio of [223,226,(1100 1100 1100 1100)]. All image blocks are encoded with the same manner, until all the blocks are processed
Example of AMBTC encoding and decoding procedures
To decode an AMBTC-compressed image, the decoder reconstructs image blocks from the compressed code. To recover an image block, if a value b i in B is 0, then the
corresponding pixel is reconstructed by the quantization level a, Otherwise, reconstructed by the quantization level b. By recovering pixels in all image blocks, the whole compressed
Image can be reconstructed. [3]
V. RESULTSANDDISCUSSION
For the result we select Hard disk image.
To compare between the used compression methods, comparison is a follows:-
O
Original image compressed image
Figure 1.BTC
Original image compressed image
Figure1. AMBTC
original Size 16384 16384
Compressed Size 2128 2096
Compression Ratio 7.699248 7.816794
blck size 32 32
Image BTC AMBTC
original Size 16384 16384
Compressed Size 2128 2240
Compression Ratio 6.918919 7.314286
blck size 16 16
Original image compressed image
Figure3. BTC
Original image compressed image
Figure 3. AMBTC
„
Original image compressed image
Original image compressed image
Figure 2 AMBTC
It is observed that, as compression ratio increases, decompressed hard disk image, contain less detail block of hard disk is also increases. For the same block size compression ratio of AMBTC image is always greater than BTC image. Here for the block size16, compression ratio for uncompressed hard disk image is 4.923077 and for compressed image 5.818182. Also for the block size8, compression ratio for uncompressed hard disk image is and for compressed image 7.314286 .
`
VII. CONCLUSIONS
In this paper, image compression using block truncation coding has been investigated. Two algorithms were selected namely, the original block truncation coding (BTC) and Absolute Moment block truncation coding (AMBTC). The two algorithms are based on dividing the image into non overlapping blocks and uses a two-level quantize. .It has been show that the image compression using AMBTC provides better image quality than image compression using BTC at the samebit rate. Moreover, the AMBTC is quite faster compared to BTC.
VIII. REFERENCES
[1] Meftah M.Almrabet, Amer R. Zerek, Allaoua Chaoui and Ali A. Akash,” Image Compression using BlocK TruncationCoding”, IJ-STA, Vol 3, No.2, PP.1046-1053, December 2009
[2] S.Vimala, P.Uma, B.Abidha “Improved Adaptive Block Truncation Coding for Image Compression” International
Journal of Computer Applications (0975 – 8887)Volume 19– No.7, April 2011
[3] 1D.Kiran Kumar , 1E.V.Narayana , ECE Department, JNT University ,Kakinada, “Lossless Stegnography for AMBTC –Compressed Color Images”
original Size 16384 16384
Compressed Size 2128 2816
Compression Ratio 4.923077 5.818182
Block size 8 8
Sunanda K.Kapde received the B.E. in Electronics Engineering from Dr.Babasaheb Ambedkar (M.S) University, Auranabad in 2003. She is now
preparing for M.E. (E & TC) degree from North Maharashtra University.Her interests include image processing and Mobile communication.