Hybrid Algorithm for Lossless Image Compression using Simple Selective Scan order with Bit Plane Slicing

: Problem statement: Identifying the new lossless image compression algorithm for high performance applications like medical and satellite imaging; a high quality lossless image is most important when reproduction which leads to classify the data for decision making. Approach: A new lossless hybrid algorithm based on simple selective scan order with Bit Plane Slicing method is presented for lossless Image compression of limited bits/pixel images, such as medical images, satellite images and other still images common in the world. Efficient coding is achieved by run length and modified Huffman coding. This approach is combined with efficient selective scan order for entire image in one pass through. Results: The new hybrid algorithm achieves good compression rate, compared to the existing schemes of coding with different test images. Conclusion: Compared to the existing standards JPEG-LS and CALIC, the compression rate is reduced with our proposed algorithm for different standard test images.


INTRODUCTION
Among the fast development of digital know-how, the requirement to save image data is growing. Lossless image compression is very much preferred in applications where the images are focused for additional processing, classification and forecasting, recognizing and frequent compression or decompression. This is usually an alternate for images obtained at extremely huge expenditure, or in applications where the preferred quality of the reconstructed image is yet unknown. Thus, satellite images (Magli, 2009), medical images (Philips et al., 2001;Ghrare et al., 2009) and other still images used in surveillance camera are all the applications of lossless compression.
Normally, lossless compression is prepared through simple sequencing of bits based on selective scan order and then the run length is calculated and modified Huffman encoding scheme is applied similar to an entropy coder. Since these samples disclose some residual correlation, modern lossless image compression schemes accept three separate and autonomous phases, slicing, sequencing and entropy coding (Podlasov and Franti, 2006;Cai and Li, 2005).
Bit plane slicing method (Podlasov and Franti, 2006) adopted for finding the eight binary layers of 8 bit image, the first layer contains the LSB and eighth layer contains the MSB of the 8 bit image. The sequencing phase is aimed to arrange the neighborhood pixels sequentially which helps to reduce the number of bits in the calculation of run lengths and then calculate the run length of binary bits through RLE method, which is used for efficient coding. Efficient entropy coding, the modified Huffman variable length coding scheme is then applied to compress the image data, based on the run lengths. The modern lossless image algorithms, for example JPEG-LS standard (Weinberger et al., 2000), the CALIC coder (Wang et al., 2007;Wu and Memon, 1997; and some other sophisticated coders (Cai and Li, 2005;Zhao and He, 2010), are based on the modeling/coding standards. Alternatively, while the modeling/coding construction can achieve high coding efficiency, this frequently results in additional computational cost, because the analysis of statistical uniqueness performed in the modeling phase is computationally expensive. But our proposed algorithm achieves high coding efficiency as well as low computational cost due to the simple sequencing operation based on the scan order sorting methods. Optimum cost is required in the coding phase, particularly when a Huffman coding is applied for compression.
Apart from this compression rate, the above algorithm are also tried to improve the computational complexity, which is also important for real world applications. For example, in the lossless JPEG standard (Weinberger et al., 2000), two different coding is specified: One is arithmetic coding and another is Huffman coding. While the compression gap between the Huffman and the arithmetic coding is considerable, the latter did not achieve extensive use, possibly due to its high complexity requirements (Podlasov and Franti, 2006;Cai and Li, 2005). Although the Run length and Modified Huffman coding scheme can be applied to reduce the coding cost, the resulting complexity might be low for some applications such as in real-time compression of images.
This reading presents a new hybrid image coding algorithm HALIC which is based on simple sequencing with scan order followed by finding the run lengths of binary bits in the bit plane, which is an easy process and encodes the run lengths by applying Modified Huffman coding scheme. In this proposed algorithm, each image is processed into four parts: (1) bit plane slicing (2) sequencing with selected scan order, (3) calculate the run lengths and (4) apply modified Huffman coding. As a result, most of the neighborhood bits are arranged sequentially based on the scan order, which is then coded with a run length and modified Huffman entropy coding algorithm. By simply coding the pixels with selected scan order and hybrid coding scheme, excellent performance can be achieved with low computational cost. Moreover, with the aid of modified Huffman coding, the images are compressed with the high coding efficiency, compared to JPEG-LS (Wang et al., 2007;Wu and Memon, 1997; and CALIC standards.

MATERIALS AND METHODS
The proposed algorithm is applied for compressing the satellite STI and medical MRI brain images STI with low computational cost. This study is organized as follows, first section presents the coding algorithm requirements followed by our proposed algorithm HALIC method have presented which includes an overall introduction and descriptions. Then, simulation results are tabulated and discussed. Finally, Conclusions are drawn.

Coding algorithm requirements:
Modified huffman coding scheme: Generally, Huffman encoding algorithm starts by constructing a list of all the symbols in descending order of their probabilities. This scheme constructs from the bottom to top, a binary tree with a symbol at every leaf. This is done in different steps, where at each step two symbols with the smallest probabilities are selected, added to the top of the partial tree, deleted from the list and replaced with an auxiliary symbol representing the two original symbols. When the list is reduced to just one auxiliary symbol (representing the entire symbol), the tree is absolute tree. The tree is then traversed to determine the code words of the symbols.
Where as our modified Huffman coding scheme is very simple, the Huffman binary tree is constructed based on the run lengths calculated from RLE method. The tree is constructed from top to bottom, starts from run length 1 to maximum run length in the image bits. For example, the Huffman tree is constructed for run lengths from 1 to 32 as shown in the Fig. 1, which contains nodes and edges. The node consists of run lengths and edge contains the binary bit either 0 or 1. The Root node is T, which is the first node, traversal starts from. This modified Huffman tree is constructed from top to bottom by arranging the run lengths in binary tree format along with assigning of binary bits 0 and 1 for every pair of child in the Huffman binary tree. There is no need of traversal to determine the code words of the run length and no need for calculating the frequency of occurrence of run lengths, therefore, time complexity is reduced. The modified Huffman table contains the different run lengths and their corresponding Huffman binary code, which is shown in Table 1. The Table 1 contains the Run length range and their corresponding Huffman binary code range. This coding scheme is a static variable length coding scheme.

Scan order selection:
In modern compression methods like JPEG-LS, Predictive modeling method is used and it exploits spatial correlations by predicting the value of the current pixel by a function of its already coded neighboring pixels. In Context models, every distinctive pixel combination of the neighborhood is considered as its own coding context. The probability distribution of the pixel values is estimated for each context separately based on past samples. In grayscale images, however, the number of possible pixel combinations is huge and only a small neighborhood can be used. The number of contexts must therefore be reduced by context quantization. This approach, combined with predictive modeling, has been used in the CALIC algorithm.
Instead of using these complex prediction and context methods, authors bring the concept of Scan order sequencing method from (Drost and Bourbakis, 2001;Maniccam and Bourbakis, 2001). A scanning of a 2-D image array is arranging the elements in an order in which each neighborhood element of the array is accessed closely once.   The Scan order is a sequencing method and is a two-dimensional spatial-accessing methodology (Drost and Bourbakis, 2001;Maniccam and Bourbakis, 2001;Memon et al., 2000;Ouni et al., 2011). Sequencing of bits can represent and generate a large number of wide varieties of scan order. In this algorithm, there are ten basic scan orders as shown in Fig. 2 have been used for sequencing the neighborhood bits in a bit plane. The time complexity of scan ordering of image array is O (n 2 ), where n x n is the order of Image array.
Only one scan order has been selected for all bit plane sequencing. Selection of scan order is based on the maximum compression achieved for the image by applying the various scan orders. The architecture of the scan order selection is shown in Fig. 3. There are no sub blocks has taken when arranging the pixels into a specific scan order like 4×4, 8×8, or 16×16 blocks; however the scan ordering is performed continuously with only one pass through the image.

Algorithm-I:
Step-1: Read the image X in array format Step-2: Repeat the Step-2 until scan order code s ≤ 9, initially s = 0 • Select the scan order code s which is 4-bit length. Arrange the pixels in X into the specific scan order s as shown in the Fig. 1. The result is stored in the Ds.
• Apply the Linear Prediction and DPCM method to find the difference on the data Ds from Step-2 (i), which improves performance of the compression. It is represented as Dp in Eq. 1 • Apply the Huffman encoding on the Dp, Step-3: Select the scan order based on the objective function in Eq. 2: Step-4: Return the s-value to the HALIC Encoder.

HALIC algorithm:
The proposed lossless image compression consists of four phases: (1) bit plane slicing (2) bit sequencing with selected scan order, (3) calculation of run lengths and (4) modified Huffman coding. Bit plane slicing method adopted for getting the eight binary layers (bit Plane-0 to bit plane-7) of given eight bit image, the first layer contains the LSB and eighth layer contains the MSB of the eight bit image. The sequencing phase is designed to arrange the neighborhood pixels sequentially which helps to shrink the number of bits. In the third phase, run length of binary bits is calculated through the so called Run Length Encoding (RLE) method, which is used for reducing the bits in the current bit plane. Finally, the modified Huffman variable length coding is applied for compressing the data based on the run lengths found in the third phase. The architecture of the proposed HALIC method is shown in Fig. 4.   Initial bit, i = 1 1 1 0 0 1 1 1 3 0 0, 0, 0 4 1 1, 1, 1, 1 2 0 0, 0 7 1 1, 1, 1 ,1, 1, 1, 1 5 0 0, 0, 0, 0, 0 2 1 1, 1 HALIC encoding algorithm: The Compression process of the HALIC algorithm has two steps.

Algorithm-II:
Step Step-2: Repeat the Step-2 until bit plane code n ≤ 7, initially n = 0: • Select the scan order code s for the image X, s is 4bit length code. Arrange the pixels of 'Z n ' into the specific selected scan order's' found by the Algorithm-I. The result is stored as 'Z ns ' • Calculate the run lengths of Z ns using RLE method, store the run length as D r and store the initial bit as 'i'. Example, Zns = [1, 0, 1, 0, 0, 0, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1] and s = 3, then Dr = [1, 1, 1, 3, 4, 2, 7, 5, 2], initial bit i = 1 and scan order s = 3 • Apply the modified Huffman encoding on D r . D r consists of run lengths of sequenced binary plane Z ns . This bits are encoded with modified Huffman coding as variable length code which is used to reduce the number of bits of D r . Then the result is stored as D rh which is shown in the Table 2 • Calculate the Compression Rate CR n (D rh , s, i) for the scan order s and Increment the n value by 1 for next bit plane compression Finally, the code book contains (D rh , s, i) n the compressed image.
HALIC decoding algorithm: Similar to the compression, the decompression process of the proposed algorithm has two steps:

Algorithm-III:
Step-1: Repeat the Step-2 until bit plane code n ≤ 7, initially n = 0: • Compressed data, (D rh , s, i)n is decoded using modified Huffman decoding technique. The decoded result for the above said example is represented as (D r , i), the result of D r is shown in the Table 3 • Decode the D r with run length decoding method and it is represented as Z ns , for example the decoded bits are tabulated in Table 4 • Arrange each bit in the selected scan order (for example, s = 3, spiral In )and it is represented as Z n Step-2: Finally Bit plane unification is done to get the reconstructed quality image, as shown in Eq. 4: for all i 1 m , j 1 m

RESULTS
To asses the performance of our proposed HALIC coder, a image test set including five images STI with a wide variety of features are used here for the simulations. These images are monochrome-8 bits/pixel images which are shown in Fig. 5.
The Lossless image coder (Drost and Bourbakis, 2001;Cai and Li, 2005), which is the core of the CALIC (Wang et al., 2007;Wu and Memon, 1997; and JPEG-LS standard (Weinberger et al., 2000), is used for comparison. The compression ratio of test images for various scan order are tabulated in Table 5, which is helpful for selecting the scan order based on the maximum compression ratio.
The compression ratio of test image bit planes with our proposed algorithm is tabulated in Table 6. The average compression ratio is limited to 3.45. Our proposed HALIC coder shows a good performance on an average in comparison with CALIC with Huffman coding and JPEG-LS.

DISCUSSION
The HALIC coder achieves good compression rate as 2.56 bits/pixel on an average compared to the performance of other lossless coders, which is shown in Table 7. This proposed HALIC algorithm is more suitable for applications like compression of medical images (Ghrare et al., 2009) and satellite images (Magli, 2009) where image classifications required.

CONCLUSION
This study addresses a new hybrid image coding algorithm based on a sequencing that is simple to cast and encode the bit planes. The core idea is to sequence the bits in the bit plane with selected scan order and then encode the bits by the combination of Run Length and modified Huffman coding scheme. Moreover, two coding modes are proposed for efficient compression requirements particularly in the applications of medical and satellite image compression. The proposed HALIC lossless coding algorithm obtains the good results when compared to the JPEG-LS and CALIC standards achieved on specified image test set.