Measure Compression Performance of an Image Compression AlgorithmThushara BandaraBlockedUnblockFollowFollowingJan 20Figure 01: Variations of Lena image based on different compression ratiosDevelopment of the fields such as Image Processing, Computer Vision and Multimedia directly affect the creation of images and videos which have excellent quality with sharp details.
Therefore file sizes of those multimedia components are huge and when storing them on a persistent memory it consumes a lot of storage.
Also, high bandwidth is needed for effective communication when transmitting huge image and video files over the Internet.
In order to overcome these problems, we can use the mechanism called Image Compression.
In this process, we compress images and reduce their file sizes using various compressions algorithms.
In this article, I am not going to cover any of those algorithms and I only focused on how we can measure the performance of those algorithms based on various measuring components.
Depending on the nature of the image compression algorithm there are various kinds of criteria can be used to measure the performance of the algorithm and the quality of the decoded (decompressed/reconstructed) image.
When measuring the performance of an image compression algorithm the main concerns would be the space efficiency and time efficiency.
Since the compression behavior depends on the irrelevance and the redundancy of image pixels, it is difficult to measure the performance of an image compression algorithm in general.
In addition, the performance also depends on the family of the compression algorithm: lossy or lossless.
As my undergraduate research, I developed a deep autoencoder-based image compression algorithm using multi-layer perceptron and I used different measuring components to measure the performance of the algorithm.
The rest of the article is organized as follows.
Under each measuring component, the description of the component, the mathematics behind the component and how we can implement it as an algorithm are discussed.
Here, all the implementations are done using Python scripts.
Compression Time (CT)In this case, the time taken for both compression and decompression processes should be investigated independently.
Some kind of applications like transferring a high resolution compressed image data or a video data over the Internet or any other communication medium, the compression time is really important, while other applications both compression and decompression time are equally important.
When the compression and decompression times are at an acceptable level, it implies that the corresponding algorithm is adequate in terms of the time factor.
With the development of the hardware technologies and the performance of machines, this factor varies from machine to machine.
In another case, the compression time is also affected by the time complexity of the compression algorithm.
Even the hardware resources are cheap, the compression and decompression times can be maintained at a very low level using an optimal implementation of an algorithm .
Anyway, let’s not waste any more time and see how we can measure the CT.
NOTE: In the context of the image processing, we need to compute both compression and decompression times as the execution time of the algorithm.
Compression Ratio (CR)The compression ratio is another important measuring component which used to measure the performance of the compression algorithm.
It’s the ratio between the size of the compressed (encoded) image and the size of the original image.
Compression Factor (CF)It is the inverse of the compression ratio.
That is the ratio between the size of the original image and the size of the compressed image.
Mean Squared Error (MSE)Compressing an image using lossy image compression algorithm results in a decompressed image with loss of some information of the pixel intensity values.
Those pixels are significantly different than the original image pixels.
The error metrics that can be used to compare the original image and the decompressed image is MSE.
It calculates the cumulative squared error between each corresponding pixels in the original and the decompressed images .
The MSE is defined as follows.
Peak Signal to Noise Ratio (PSNR)In image compression, the value of PSNR measures the ratio between the maximum possible intensity value (power) of an image (signal) and the power of distorting noise that affects the quality of its representation as a logarithmic decibel scale.
A higher PSNR value provides higher image quality and the other end of the scale, a smaller PSNR value implies high numerical differences between both original image and the decompressed image .
The PSNR is defined as follows.
Structural Similarity Index Measure (SSIM)The SSIM is a well-known perceptual metric that quantifies the degradation of images.
It needs two images from the same image capture as same as measuring PSNR.
Unlike PSNR, SSIM based on the visible structure in images and measure the similarity between the original image and the decompressed image  .
The formula of the SSIM is based on three comparison measurements between the samples of x and y as given by the below figures of equations.
(05)(06)(07)(08)Then the SSIM can be calculated as a weighted combination of the 5, 6 and 7 measures.
The resultant value of the SSIM index is a decimal value between -1 and 1, and when the value 1 is reached the given original image and the decompressed image are identical.
When the image compression algorithm is a lossy algorithm, the SSIM value is not equal to the value 1 but should close to the value 1 for the acceptance of the algorithm.
(09)By finishing this article, you will gain a better understanding of how we can measure the compression performance using different performance matrices.
Since this is my first article please let me know your comments below.
You can connect with me on LinkedInREFERENCES: S.
Amarasinghe; Comparison of Lossless Data Compression Algorithms for Text Data; Indian Journal of Computer Science and EngineeringVol 1 No 4 416–425 Todd Veldhuizen; Measures Image Quality; http://homepages.
html Peak Signal-to-Noise Ratio as an Image Quality Metric; http://www.
com/whitepaper/13306/en/ SSIM: Structural Similarity Index; http://www.
Sheikh and E.
Simoncelli, “Image quality assessment: From error visibility to structural similarity,” IEEE Transactions on Image Processing, vol.