Sie sind auf Seite 1von 5

Council for Innovative Research www.cirworld.

com

International Journal of Computers & Distributed Systems Volume 1, Issue 2, August, 2012

A Novel Approach of Lossless Image Compression Using Two Techniques


Tanureet Kaur
GNDEC, Ludhiana Punjab, India

Amanpreet Singh Brar


Prof. & Head, GNDEC, Ludhiana, Punjab, India
resemble a small amount of additional noise, no harm is done. Compression techniques that allow this type of degradation are called lossy. This distinction is important because lossy techniques are much more effective at compression than lossless methods. The higher the compression ratio, the more noise added to the data [3]. 1.1.1. Delta encoding Delta encoding can be used for data compression when the values in the original data are smooth, that is, there is typically only a small change between adjacent values. This is not the case for ASCII text and executable code; however, it is very common when the file represents a signal there exist many compression schemes, the right one to use in a particular situation depends largely on the type of data being compressed. The greater the compression ratios the more dependent the method tends to be to characteristics of the data. So for example, greater compression ratios can be achieved if run length encoding is applied to black and white drawings than if it is applied to colour photographs. JPEG gives better compression ratios for photographs than a general compression method such as GZIP. Many compression algorithms achieve very large compression ratios by "changing" the data. The changes are often cleverly made so that they aren't noticeable, for example, JPEG degrades the image in ways that the human visual system is not sensitive to. Some audio compression methods approximate the original signal with considerations of the limitations in the target playback system. A requirement with many recordings for scientific analysis is the data must not be degraded in any way; this is often referred to as a lossless compression method. In many time series derived from sampling continuous signals, the transition between samples is often much less than the total range available for the samples. For example, an acquisition system might store each sample in 16 bits, however since each subsequent sample usually changes slowly the difference between two samples can be stored in fewer bits. This is the essence of delta coding; store the changes instead of the absolute values. Of course the first sample needs to be stored in full resolution and occasionally there might be a larger transition. To cope with this a flag is normally used to indicate whether or not the next sample is a delta or absolute value. One disadvantage of delta coding is common when the file represents a signal. For instance, Fig. 1(a) shows a segment of an audio signal, digitized to 8 bits, with each sample between -127 and 127. Figure 1(b) shows the delta encoded version of this signal. The key feature is that the delta encoded signal has lower amplitude than the original signal. In other words, delta encoding has increased the probability that each sample's value will be near zero, and Decreased the probability that it will be far from zero. This uneven probability is just the thing that Huffman encoding needs to operate. If the original signal is not changing, or is

ABSTRACT
With the advent in technology, there exist many compression schemes, each being unique in itself. However, the decision to use one in a particular situation is dictated largely by the type of data being compressed. The greater the compression ratios the more dependent the method tends to be. Several lossless techniques have been proposed so far for Image Compression. Here we study a lossless image compression using two techniques i.e. Delta encoding and Run length. Delta encoding is a simple compression scheme for audio, EEG, and general time series data files. Numerous past researches projects have observed that one can compress one object relative to another one by computing the differences between the two, delta-encoding systems have almost invariably required knowledge of a specific relationship between them most commonly. The idea of delta encoding to reduce communication or storage costs is not new. Using lossless run length encoding technique together we propose a new algorithm for lossless image compression.

Keywords
Delta encoding, Run length encoding

1. INTRODUCTION
Data transmission and storage cost money. The more information being dealt with, the more it costs. In spite of this, most digital data are not stored in the most compact form. Rather, they are stored in whatever way makes them easiest to use, such as: ASCII text from word processors, binary code that can be executed on a computer, individual samples from a data acquisition System, etc. Typically, these easy-to-use encoding methods require data files about twice as large as actually needed to represent the information. Data compression is the general term for the various algorithms and programs developed to address this problem. A compression program is used to convert data from an easy-to-use format to one optimized for compactness. Likewise, an uncompressed program returns the information to its original form. Various techniques for data compression are simple encoding techniques called run length del-ta and Huffman encoding. 1.1 Data Compression Strategies The methods have been classified as either lossless or lossy. A lossless technique means that the restored data file is identical to the original. This is absolutely necessary for many types of data, for example: executable code, word processing files, tabulated numbers, etc. You cannot afford to misplace even a single bit of this type of information. In comparison, data files that represent images and other acquired signals do not have to be keeping in perfect condition for storage or transmission. All real world measurements inherently contain a certain amount of noise. If the changes made to these signals

61 | P a g e www.cirworld.com

Council for Innovative Research www.cirworld.com

International Journal of Computers & Distributed Systems Volume 1, Issue 2, August, 2012

changing in a straight line, delta encoding will result in runs of samples having the same value.

of the characters, or all of the characters. A good example of a generalized run-length scheme is Pack Bits, created for Macintosh users. Each byte (eight bits) from the input file is replaced by nine bits in the compressed file. The added ninth bit is interpreted as the sign of the number. That is, each character read from the input file is between 0 to 255, while each character written to the encoded file is between -255 and 255. To understand how this is used, consider the input file: 1,2,3,4,2,2,2,2,4 , and the compressed file generated by the Pack Bits algorithm: 1,2,3,4,2,&3,4. The compression program simply transfers each number from the input file to the compressed file, with the exception of the run: 2,2,2,2. This is represented in the compressed file by the two numbers: 2,-3. The first number ("2") indicates what character the run consists of. The second number ("-3") indicates the number of characters in the run, found by taking the absolute value and adding one. For instance, 4,-2 means 4, 4, 4; 21,-4 means 21, 21,21,21,21, etc. Original Stream

Run-length encoded FIGURE 1.2 Example of run-length encoding: Each run of zeros is replaced by two characters in the compressed file: a zero to indicate that compression is occurring followed by the number of zeros in the run. An inconvenience with Pack Bits is that the nine bits must be reformatted into the standard eight bit bytes used in computer storage and transmission. A useful modification to this scheme can be made when the input is restricted to be ASCII text. In other words, the values 127 through 255 are not defined with any standardized meaning, and do not need to be stored or transmitted. This allows the eighth bit to indicate if run-length encoding is in progress. [3]

FIGURE 1(a) and 1(b) Example of delta encoding: Figure (a) is an audio signal digitized to 8 bits. Figure (b) shows the delta encoded version of this signal. Delta encoding is useful for data compression if the signal being encoded varies slowly from sample-tosample. 1.1.2 Run-Length Encoding Data files frequently contain the same character repeated many times in a row. For example, text files use multiple spaces to separate sentences, indent paragraphs, format tables & charts, etc. Digitized signals can also have runs of the same value, indicating that the signal is not changing. For instance, an image of the nighttimes sky would contain long runs of the character or characters representing the black background. Likewise, digitized music might have a long run of zeros between songs. Run-length encoding is a simple method of compressing these types of files. Figure 1.2 illustrates runlength encoding for a data sequence having frequent runs of zeros. Each time a zero is encountered in the input data, two values are written to the output file. The first of these values is a zero, a flag to indicate that run-length compression is beginning. The second value is the number of zeros in the run. If the average run-length is longer than two, compression will take place. On the other hand, many single zeros in the data can make the encoded file larger than the original.Many different run-length schemes have been developed. For example, the input data can be treated as individual bytes, or groups of bytes that represent something more elaborate, such as floating point numbers. Run-length encoding can be used on only one of the characters (as with the zero above), several

2. RELATED WORK IN THE FIELD OF LOSSLESS COMPRESSION AND DECOMPRESSION


A new lossless method of image compression and decompression using Huffman coding techniques shows that the higher data redundancy helps to achieve more compression. A new compression and decompression technique is based on Huffman coding and decoding for scan testing to reduce test data volume, test application time. So other methods of image compression can be carried out as namely JPEG method, Delta encoding Entropy coding, etc. [1] An Efficient Lossless ECG Compression Method Using Delta Coding and Optimal Selective Huffman Coding proposed an efficient lossless ECG compression based on delta coding and optimal selective Huffman coding and implement the proposed algorithm in the some development board. The delta coding is applied to reduce the dynamic range of the original ECG signals. The optimal selective Huffman coding is used to enhance the computation efficiency of canonical Huffman coding. Comparing with the canonical Huffman coding

62 | P a g e www.cirworld.com

Council for Innovative Research www.cirworld.com

International Journal of Computers & Distributed Systems Volume 1, Issue 2, August, 2012

algorithm, the proposed algorithm has gained much improvement [4] Delta compression for fast wireless Internet download presents a theoretical framework for delta compression based on information theory and Markov models, including insights into the compression bounds. They also simulated and implemented a generic delta compression scheme and demonstrated its real-time and non real-time performance by applying the scheme on binary data. It will be shown that our delta compression scheme is able to improve the real-time performance of wireless Internet download by up to 4 times [7] Lossless Grey-scale Image Compression using Source Symbols Reduction and Huffman Coding proposed technique achieves better compression ratio than the Huffman Coding. The experiment also reveals that the compression ratio in Huffman Coding is almost close with the experimental images. This enables to achieve better compression ratio compared to the Huffman coding. Further, the source symbols reduction could be applied on any source data which uses Huffman coding to achieve better compression ratio. Therefore, the experiment confirms that the proposed technique produces higher lossless compression than the Huffman Coding. Thus, the proposed technique will be suitable for compression of text, image, and video files. [2] Modified delta encoding and its applications to speech signal presents a modified delta encoding method and its applications to speech signal are proposed. In this method, Hungarian algorithm is applied to find the minimum distance of arbitrary two frames in speech signal and minimum spanning tree is used to find an effective delta encoding path. In simulation, the method is applied to the compression of sinusoidal coding. The results show that the data size after compression is 6% smaller than a usual delta encoding whose path is not suitably permutated. In addition, the proposed method has the potential to apply on data security for practical use because the delta encoding path which can be used as the security key is unordered and long enough. [5]

Delta and run length encoding Inverse of run length and delta encoding Parameters compared: PSNR MSE RMSE 3.1.1 Delta and run length encoding Here first delta encoding and then run-length encoding are applied to the source image to obtain a compressed image.

3. PROPOSED ALGORITHM
Delta encoding and run-length encoding are two compression techniques. Run-length encoding (RLE) is a very simple form of data compression in which runs of data (that is, sequences in which the same data value occurs in many consecutive data elements) are stored as a single data value and count, rather than as the original run. This is most useful on data that contains many such runs: for example, simple graphic images such as icons, line drawings, and animations. It is not useful with files that don't have many runs as it could greatly increase the file size. By delta encoding the audio data, we can exploit the fact audio data very often changes just a little between samples and so the generated delta values (the amount of change) need less bits to be expressed. However, you cant store 16-bit data with e.g. 8-bit delta values since it is not assured the change is always small enough to be stored in 8 bits, requiring the use of 16-bit delta values in the worst case. Here we are proposing an algorithm where we use both of these techniques to generate a lossless image data. Delta encoding together with run length encoding generates a lossless image. This algorithm works on any type of image. Proposed algorithm Consist of following basic principal mechanisms:

In the first step the input image is converted into delta encoded image when delta encoding is applied to the image. This is the essence of delta coding; store the changes instead of the absolute values. Of course the first sample needs to be stored in full resolution and occasionally there might be a larger transition. To cope with this a flag is normally used to indicate whether or not the next sample is a delta or absolute value. In the next run length encoding is applied to the delta encoded image to obtain a run length encoded image which is again a lossless technique. Here we get a compressed image 3.1.2 Inverse of run length and delta encoding

63 | P a g e www.cirworld.com

Council for Innovative Research www.cirworld.com

International Journal of Computers & Distributed Systems Volume 1, Issue 2, August, 2012

Here the compressed image obtained from previous step is converted into decompressed i.e. lossless image by applying inverse run length and delta decoding. This is how we get a lossless image with the help of two lossless techniques. This Algorithm can be applied to any image. This is the biggest advantage of this algorithm. 3.2 .1 Parameters Compared P.S.N.R and MSE The PSNR block computes the peak signal-to-noise ratio, in decibels, between two images. This ratio is often used as a quality measurement between the original and a compressed image. The higher the PSNR, the better the quality of the compressed or reconstructed image. The Mean Square Error (MSE) and the Peak Signal to Noise Ratio (PSNR) are the two error metrics used to compare image compression quality. The MSE represents the cumulative squared error between the compressed and the original image, whereas PSNR represents a measure of the peak error. The lower the value of MSE, the lower the error. To compute the PSNR, the block first calculates the meansquared error using the following equation:

When this parameter was compared in this algorithm between original image and decompressed image then result was 0.

4. RESULT AND CONCLUSION


Our terminal objective is to obtain a lossless image method. Delta encoding and Run-length encoding are the techniques which are used collectively to obtain a new method to obtain a lossless image. Here we have validated the results with the help of various parameters. The following figures show the input image and resulting decompressed image

In the previous equation, M and N are the number of rows and columns in the input images, respectively. Then the block computes the PSNR using the following equation:

Figure 4.1: Original Image(JPG)

In the previous equation, R is the maximum fluctuation in the input image data type. When both of these parameters were compared in this algorithm between original image and decompressed image then PSNR is infinite and MSE is 0.

RMSE

Figure 4.2: Delta encoding Image


Root-mean-square error (RMSE) is a frequently used measure of the differences between values predicted by a model or an estimator and the values actually observed. RMSD is a good measure of accuracy.

The RMSD of an estimator with respect to the estimated parameter is defined as the square root of the mean square error

Figure 4.3: Delta decoding Image

64 | P a g e www.cirworld.com

Council for Innovative Research www.cirworld.com

International Journal of Computers & Distributed Systems Volume 1, Issue 2, August, 2012

obtained with the help of proposed method gives better results than the technique based on DCT. This lossless image method is only used for obtaining lossless image. No pixels have been broken in this method. This is a cost effective method .The disadvantage of this method is that it does not give a coloured image result. In this research, the proposed approach has been implemented on various types of images formats (GIF, JPG, BMP, PNG, etc). The results in each scenario validates the proposed algorithm and it gives optimized results.

5.1 Future Work Figure 4.4: Decoded Image


Let us now compare this method with a lossy image compression technique and see the difference. As we draw a comparison between this method and DCT (Discrete Cosine Transform), a lossy image compression technique, then following are the results Further research work may focus on developing some new algorithms, which involve combining both techniques (lossless and lossy) to yield results, wherein higher compression ratios may be achieved and also the end result may be a coloured image.

6. ACKNOWLEDGEMENT
I am extremely grateful to Professor Amanpreet Singh Brar, Head of the Department, CSE Department, GNDEC, Ludhiana, for encouraging and helping me in carrying out the present work. Without his wise counsel and able guidance, it would have been extremely difficult to complete this herculean task in the given time frame.

7. REFERENCES
[1] Jagadish H. Pujar, Loh it M. Kadlaskar (2010) A new lossless method of image compression and decompression using Huffman coding techniques Journal of Theoretical and Applied Information Technology

Figure 4.5: DCT Image

[2] C. Saravanan, R. Ponalagusamy (2010) Lossless Grey-scale Image Compression using Source Symbols Reduction and Huffman Coding International Journal of Image Processing (IJIP), Volume (3): Issue (5) [3] The Scientist and Engineers Guide to Digital Signal Processing by Steven W. Smith.Ph.D [4] G.C Chang Y.D Lin (2010) An Efficient Lossless ECG Compression Method Using Delta Coding and Optimal Selective Huffman Coding IFMBE proceedings 2010, Volume 31, Part 6, 1327-1330, DOI: 10.1007/978-3-642-14515-5_338.

Figure 4.6: IDCT Image


When parameters (PSNR, MSE, RMSE) highlighted in Proposed Algorithm were compared between both the decompressed images then there was a vast difference, which however, is not visible to the naked eye As evident from the results shown above, the performance of proposed lossless method for image compression when compared with the lossy DCT technique was far superior.

[5] Ma, Y.; Noda, H.; Ito, I.; Nishihara, A. ;( 2010) Modified delta encoding and its applications to speech signal Tencon 2010 - 2010 IEEE region 10 conference Page(s): 495 - 498 [6] Gokmen, M.; Ersoy, I.; Jain, A.K. ;( 1996) Compression of fingerprint images using hybrid image model image processing 1996. Proceedings. International Conference volume 3. [7] Chunpeng Xiao; Bing, B.; Chang, G.K.; (2005) Delta compression for fast wireless Internet downloads Global Telecommunications Conference, 2005. GLOBECOM '05. IEEE volume (1)

5. CONCLUSION AND FUTURE WORK


In this paper, we have presented a novel approach of lossless image compression using two techniques. The results presented are preliminary and there is a lot of scope for improvement to develop this algorithm. Based on the results presented in the previous chapter, I conclude that the image

65 | P a g e www.cirworld.com

Das könnte Ihnen auch gefallen