Lossy Image Compression by Rounding the Intensity Followed by Dividing ( RIFD )

Several millions of digital images are transmitted every minute via mobile applications. The main feature of these images is their huge sizes. However, most of their details are not important such as natural images. Continuous efforts are achieved to utilize the wireless bandwidth and capacity for mobile users. One of the most significant efforts is the image compression. The aim of this study is to introduce a new lossy technique called RFID for compressing images, in order to overcome these problems by achieving high compression ratio. The proposed technique depends on increasing the redundancy and similarity among the neighboring pixels of images by rounding the pixels' intensities followed by the dividing process, which makes compression feasible. It can be applied alone or followed by any lossless compression algorithm. Experimental results show a great performance when RIFD followed by Huffman algorithm.


INTRODUCTION
Image compression is the method of decreasing the image size without affecting the image quality or it will be affected at an acceptable level.Thus, images transmission over networks can be obtained by the compressed size which saves the memory space, as well (Mathur et al., 2012).However, complexities of the compression algorithms should be low enough for a given system in addition to enhance the transmission throughput.
Lossless and lossy are the two main categories of compression.In lossless compression, the original image file can be recovered from the compressed one.In this category of compression only a few mechanisms are followed for the reduction of data and then the data reduction is very restricted (White Paper, 2008).Lossy compression are particularly convenient for specific applications such natural images where slight (or not perceived) loss of accuracy is not noticeable and passable to accomplish a significant decreasing in bit rate.
Lossy compression techniques are relinquishing a specific loss of fidelity in transmission for fully incremented compression.These techniques behave effective when implemented on the digitized voices or digital natural images.By their nature, the analog representations of these digital forms are not exemplary to start with; consequently it will be acceptable if the input and output are not exactly matching (Nelson, 1992).
After a famous algorithm called Huffman (1952) coding was introduced in 1952 many though that no more research was needed in this area because Huffman (1952) was performing optimally.A few decades later several new algorithms were starting to develop which fixed some of the problems that had been discovered with the Huffman algorithm.
Evolution of lossy compression techniques is motivated by comprehensive researches in 1980s, which concentrate on the human eye limitations.So, all of lossy algorithms depends on the fact that little adjustments and loss of information via coding/encoding processes overwhelmingly do not destroy the image quality as realized by the human eyes.Smaller files and shorter encoding time are the target to be developed by many commercial companies and different researchers for many years.
In a particular space of memory, reduced image size by compression algorithm is assisting in store additional images.It also decreases the required time to transmit images over the Internet (Verma et al., 2012).So, the main objective of this study is to develop and propose a new lossy image compression technique where a slight information loss is accepted.However, the proposed compression technique has a very significant feature which is considerable compression efficiency.

IMAGE COMPRESSION BACKGROUND
Image compression techniques encode the original images with less number of bits by reducing the redundancies of pixel values into an image and to transmit or store them in an effective shape (Wei, 2008).
Accessing the multimedia through Internet and the telecommunications network makes the demand for communication of multimedia is increasing dramatically.With the explosive growing of digital cameras and its use, then transferring, manipulating and storing of digital images become very important subjects to be handled especially that images sizes are very large and takes most of the disk spaces.The main partition of the communication bandwidth is occupied by the multimedia data which comprises the image data.Consequently developing of robust image compression techniques is totally mandatory (Ames, 2002).Digital images have a common feature where there is high correlation between the neighboring pixels, which causes highly information redundancy.The main goal of image compression techniques is to represent the images with less correlated pixels.Generally in image compression, irrelevancy and redundancy are used as two primary principles.In Irrelevancy, not noticeable pixel values are neglected and the redundancy is removed from the original image in the Redundancy (Gautam, 2010).

How an image is stored?
A digital image can be represented by a two (grayscale image) or three (colored image) dimensional array of pixels.When the image is a grayscale, then the pixels will have a positive integer numbers as the intensities values.The typical bit depth of grayscale images could be 8 or 16 bits, then the range of pixel values of the image will be between 0 to 2^N-1 (Where N is bit depth).For example, if the bit-depth is 8 then the range of intensity values will be between 0 and 255.White is 255, Black is 0 and the gray levels will be represented by the other values 1 to 254).These values are encoded using binary code representation, 11111111 is the code for 255 and 10000111 is code for 135 as the following: Equivalent to 135 in decimal coding system, the summation of all values above every one: 128+4+2+1.
The compression algorithms of colored images can be derived from the compression algorithms of grayscale images (Starosolski, 2007).In the colored images, each pixel is represented by three values for: red, green and blue known as RGB (each color occupies 8 bits and the total of 24 bits).In an RGB image, an additive color model is used to represent the color by merging the intensities for the three components RGB of the pixel (Pane and Joe, 2005).For example, black is represented by setting the zeros for red, blue and green.To represent white, the maximum value 255 will be set for RGB for the pixel.The other colors are represented by merging the three colors with different intensity values results a new color as single value for the pixel (Pane and Joe, 2005).

Compression performance measures:
Measuring the compression algorithm performance depends on the type of the application and based on the different criteria that used.However, the capacity efficiency is the main performance criterion (in other cases, time efficiency can be considered).Generally, measuring the image compression algorithm performance is sophisticated and it is not an easy task because the manner of compression depends on bit-stream redundancy in the original image.The performance could depend on the structure and the type of the original image or it is based on the compression algorithm category: lossless or lossy.If a lossless image compression algorithm is measured, then the time and capacity efficiencies will be less examined when the measuring will be for the lossy compression ones.
The Performance of compression algorithms can be measured or evaluated using one or more of the following (Kodituwakku and Amarasinghe, 2007): All the above evaluation measures use the image size in order to examine the efficiency of the algorithm.However, other performance evaluation measures can be used such: probability distribution, computational complexity and compression time.
Specifically, the quality measures of lossy algorithms can be classified into: Subjective and Objective measures.In the subjective, the compressed image will be evaluated by human observer who judges the quality of the algorithm based on the quality rating in Table 1 (Frendendall and Behrend, 1960):

RIFD (THE PROPOSED ALGORITHM)
Most the digital images have the same feature which is an information redundancy.These redundancies could be removed as much as possible by minimizing the bit-depth of the pixels' values into minimal number of bits in order to accomplish high compression ratio.The proposed algorithm in this study tries to remove or minimize the information redundancy included into the images while keeping its recognized visual quality and comparable to the original one.For instance; if the bit-depth for each pixel in the original image is 8 bits and the compression algorithm reduces the required bits to 5, then the image will be compressed.The only drawback of this algorithm is there will be some precision loss and some slight distortions could not be negated.However, as one of lossy compression this algorithm produces an acceptable distortion in many imaging applications because a slight loss in the image is not noticed by the human eye.
The main idea of the proposed algorithm is based on two facts: • The neighboring pixels are correlated or very similar • The human eye can perceive a very limited number of intensities.So; if the intensity values of the adjacent pixels are rounding to the same value, then the redundancy will increase and the updated intensity values will not noticeable by human eyes.
Increasing the information redundancy assists the image to be more compressed.Therefore, finding a less correlated representation of image is one of the most important tasks.
One of the basic concepts in compression is the reduction of redundancy and irrelevancy.This can be done by removing duplication from the image.Sometime, Human Visual System (HVS) cannot notice some parts of the signal, i.e., omitting these parts will not be noticed by the receiver.This is called as Irrelevancy.
The basic idea of the proposed algorithm is to check the whole pixels and transform each pixel into a number divisible by 10 according to the following conditions.Here, a new formula is proposed to transform any number in the range 0-255 into a number that when divided by 10 the result is always lying between 0-9.Therefore, the pixels 200, 201 and 202 are the same for the human eye.Hence, a novel algorithm have been proposed to transform each pixel in the range 0-255 into the following numbers 0, 10, 20, 30, 40,…, 200, 210,..., 250, (i.e., multiples of 10).After that, it narrows the range of pixel values which can be represented by 5 bits rather than 8 bits by dividing the Additionally, it can be seen that the new pixels are always having zero remainder when divided by 10.Consequently, the resulting numbers are multiples of 10 between 0-250, which are 26 values: 0, 10, 20, 30, … and 250.Hence, if we divide these numbers by 10 again we will get remainder range from 0-25.Now, let us take a practical example, Fig. 1 is an exactly 8×8 block have been taken from any arrays in any image.
After the rounding step of RIFD is applied (i.e., transform each pixel into multiple of 10), the new 8×8 block will be as in Fig. 2.
After the dividing step of RIFD is applied (i.e., decrease the bit-depth of each pixel), the new 8×8 block will be as in Fig. 3.It is well known that every decimal number 0-255 is represented by 8-bits (1 byte: ASCII coding representation).After transformation into by ten and making each number between 0-25 (255/10 = 25).So, every new intensity value will be represented by 5 bits only as shown in Table 2.
The main benefit of the RIFD is to increase redundancy or the probability of each pixel (it can notice that from Fig. 2).Thus, this will prepare the image to be much compressed efficiently using any lossless technique such as Huffman coding.

How RIFD does work?
Encode phase (Assume that the bit-depth is 8 bits): • Read an intensity value f(x, y).
• The intensity value in each image pixel is rounded to the nearest tenth.For example, if the intensity value is 157, then it will be rounded to 160.• Divide the rounded intensity by 10 and store it as new intensity value g(x, y).For example, 160 is divided by 10 and then 16 will store as new intensity value for g(x, y).• To optimize RIFD, Huffman technique could be implemented in order to increase the compression performance.
Important note: If the encode phase is implemented on the colored images, then the pervious steps will be applied 3 times on the RGB for each pixel (Matlab code to process colored images in Appendix-A).If the bitdepth is 16, then the intensity will be rounded to the nearest thousand and then divided by 1000.For example, if the intensity is 64,235 it will be rounded to 64,000 and then divided by 1000 to produce new intensity 64.So, all new intensity values will be between 0 and 66 (i.e., every new intensity value will be represented by 6 bits).

Decode phase:
• Decode the code generated by Huffman algorithm.
• Multiply each intensity value by 10.For example, 16 multiply by 10 to retrieve the rounded intensity value 160.

RESULTS AND DISCUSSION
This section presents the experiment accomplished in order to evaluate the performance of RIFD.Matlab R2010a is used in all experiments and it shows that the proposed algorithm is very significant improvement in the compression ratios values.
A new test set of several natural continuous colored and grayscale images was designed to examine the performance of RIFD algorithm.The major cause of designing this set was that there is no overtly obtainable standard set of test images including huge images with high quality, which were primarily obtained with different sizes and bit-depths 8 and 16 bits of grayscale and colored images.The set include natural continuous colored and grayscale images of different bit depths (8 and 16 bits), different sizes (up to 181,737 bytes) and format (png and jpg).

CONCLUSION
This study presents a novel lossy image compression algorithm called RIFD.The mechanism of RIFD works by rounding and dividing the intensity of each pixel in the image.This will decrease the range of the intensities and then increase the redundancy of these intensities which helps in better compression performance.Its results are especially good for all natural images of high bit depths and for colored images.

Table 1 :
Rating of compressed image quality 2 Fine An image of high quality, providing enjoyable viewing.Interference is not objectionable.3 Passable An image of acceptable quality.Interefence is not objectionable.4 Marginal An image of poor quality; you wish you could improve it.Interefence is somewhat objecetionable.5 Inferior A very poor imag, but you could watch it.Objectionable interefence is definitely present.6 Unusable An image so bad that you could not watch it.

Table 2 :
Binary representation for pixel values from 0 to 25

Table 3 :
Comparative between Huffman and RIFD based on CR