International Journal of Electrical, Electronics and Data Communication, ISSN: 2320-2084 Volume-5, Issue-6, Jun-2017 http://iraj.in COMPARATIVE STUDY ON THE IMAGE COMPRESSION OF PHOTO SHARING SITES USING MEAN SQUARE ERROR, PEAK SIGNAL TO RATIO AND DATA-RATE SAVINGS

1GIMA S. BATINGGAL, 2JASMIN D. NIGUIDULA

1Colegio de San Juan de Letran-Calamba Bucal, Calamba City, Philippines 2Technological Institute of the Philippines-Manila Manila, Philippines E-mail: [email protected], [email protected]

Abstract- Nowadays, lots of people are very enthusiastic when it comes to sharing of photos in social media sites or photo sharing sites (Madden, Lenhart, Cortesi, Gasser, Duggan, Smith and Beaton, 2013). However, it is observed that when photos are uploaded the qualities of the pictures were reduced. This study evaluated the image compression of various sites using mean square error (MSE), peak signal-to-noise ratio (PSNR) and data-rate savings to determine which site will produce a better quality picture and allocates lesser memory space. The results attained from this study showed that there are several photo sharing sites that gave out zero noise in image downloading and uses high data-rate saving.

Keywords- Netizens, reconstructed image, noise, dimension, bits per pixel

I. INTRODUCTION specifications as to the graphical formats that can be used on the Web. All you need is a MIME type, so According to Merriam Webster, “social media site is that the format is labeled correctly for transfer across a form of electronic communication”. It was used for the Web.” Moreover, Facebook Help Center only social networking and micro blogging. Netizens supports certain types of image formats and it create communities online to share information and recommends using .jpg, .bmp, .png, .gif and .tiff other contents like pictures and videos. files. However, Hill (2013) stated that “.tiff files are Consumer psychologist Dr. Leah Tierney (2015) said huge and take forever to upload. That is why people around the world are indulge in sending uploading .tiff is not worth the effort”. messages in Tweeter, sharing information and life Furthermore, the study does not discuss how the experiences on Facebook, current adventures on image compression algorithm works on these sites Instagram, and uploading and downloading since the developers of the sites did not disclose numerous videos on Youtube. In line with this, Dr. concrete data about their image compression Tierner found out five main reasons why people algorithm. Text, audio and video are also not part of behave the way they do. These includes: (1) to this study due to time constraints. express one’s identity; (2) to build rapport; (3) for an The result of this study can be used as reference in incentive; (4) to feel a sense of belonging; and (5) to understanding the level of and data-rate advocate great content”. saving found in the image compression of various However, this doesn’t give the people knowledge on photo sharing sites. which social media sites or photo sharing sites will provide better quality pictures and will allocates II. LITERATURE REVIEW lesser memory space. For this reason, the researchers would like to evaluate the image compression of “Image compression is an application that reduces various photo sharing sites by means of mean square the size of an image in bytes”. The reduction in file error (MSE), peak signal-to-noise ratio (PSNR) and size allows extra amount of memory space and data-rate saving. minimizes the time needed for pictures to be sent or To identify which site to include in this study, the downloaded from World Wide Web (Bose, researchers considered the best and most popular Madhulika, & Acharjee, 2014). photo sharing websites. According to As regards to compression technique or compression TrendingTopMost.com, AllTop9.com, algorithm, this actually refers to compression and Techlicious.com and Tomsguide.com, the most reconstruction algorithm. According to Sayood popular photo sharing sites include Facebook, (2006), “the compression algorithm takes an input X Instagram, Imgur, Flickr, Photobucket, Shutterfly, and produces a representation Xc”. While the SmugMug, Zenfolio, GooglePhotos and Tumblr. “reconstruction algorithm operates on the Concerning image format, the researchers decided to compressed representation Xc to generate the use JPG, GIF, PNG and BMP. According to reconstruction Y.” Compression algorithm can be www.w3c.org, “there is no limit in the Web

Comparative Study on the Image Compression of Photo Sharing Sites using Mean Square Error, Peak Signal to Noise Ratio and Data-Rate Savings

114 International Journal of Electrical, Electronics and Data Communication, ISSN: 2320-2084 Volume-5, Issue-6, Jun-2017 http://iraj.in classified as lossless or lossy compression. Lossless compression “guarantees full reconstruction of the original data without incurring any distortion in the process”. On the other hand, lossy compression involves losses of some information from the original data (Asolkar, Zope, Suralkar, 2013). On the other hand, according to MathWorks.com, there are two kinds of quality metrics for image. These are peak signal to noise ratio or PSNR and structural similarity or SSIM index. “PSNR is simple Figure 1. Screenshot of a Java Program that Gets the RGB to calculate but sometimes does not align well with values of an Image 3.2 Performance Evaluation Parameters perceived standard quality” while “SSIM is based on 3.2.1 Data-Rate Saving the principle that the human visual system is good Data-rate saving metric is a measurement to know for extracting information based on structure”. the amount of storage reduced after an image In addition, Huynh-Thu and Ghanbari (2012) have compression. shown that “PSNR can be a valid quality measure if The equation for data-rate saving is: the data content and the codec type are not changed”. Data-rate saving = 100 – (1- B1 / B0) Table 1 shpows the number of colors in an image Where according to the number of bits per pixel based B0: refers to the file size of the original picture onTutorialspoint.com. Table 1. Number of Colors in an Image According B1: refers to the file size of the reconstructed picture to Bits per Pixel For example: If B0 = 80.4 KB and B1 = 30.4 KB then

3.2.2 PSNR and MSE PSNR is a metric for comparing the reconstructed image of different image compression algorithms. III. METHODS According to National Instruments (2013), “PSNR refers to the ratio between the maximum possible 3.1 Data Acquisition value (power) of a signal and the power of distorting The experiment started with uploading and noise that affects the quality of its representation”. downloading of 8-bit pictures in the photo sharing Different image compression algorithm can be sites. The dimension of each downloaded images are compared scientifically using the same test image to identified to know if the site is qualified for the determine which algorithm produces better results. experiment. Instagram.com was excluded from this The formula for PSNR is: study, because the dimension of the original test data PSNR = 20 log10 Maxf /√MSE or image is not equal to the downloaded image. Where, The researchers acquired the RGB values in the MAXf refers to the maximum signal value present in picture using a java program. They used getWidth() the original image. For example, if the test data is an and getHeight() methods to get the width and height 8-bit image, then Maxf value is 255 since the color of an image. The values of width and height were for 8-bit image are 0 to 255. Take note that these used in defining the length of the 2D image. Also, values have its corresponding color representation. they applied the image.getRGB() method to get the MSE is a measure of level of distortion of the red, green and blue (RGB) on every elements of the reconstructed image from the original image. 2D image. The equation for MSE is: m-1 n-1

1 ∑ ∑ || f(i,j) – g(i,j) ||2 MSE = mn Where 0 0 f is the array of data in the original image; g is the array of data in the reconstructed image; i refers to the index of each row in the 2D image; j is the index of each column in the 2D image;

Comparative Study on the Image Compression of Photo Sharing Sites using Mean Square Error, Peak Signal to Noise Ratio and Data-Rate Savings

115 International Journal of Electrical, Electronics and Data Communication, ISSN: 2320-2084 Volume-5, Issue-6, Jun-2017 http://iraj.in m refers to the total number of vertical pixels in the have 0% data-rate savings since its file size does not 2D image and change after reconstruction. n is the total number of horizontal pixels in the 2D image. On the other hand, a sample data were presented below to show how to compute the PSNR and MSE using the RGB values in Table 2 and Table 3.

Figure 2. Data-Rate Saving of the Test Data in JPG Format Figure 3 shows that Facebook.com has the highest data-rate saving based on its value of 90%. However, Imgur.com, Flickr.com, Photobucket.com,

SmugMug.com, GooglePhotos.com and Tumblr.com First, get the summation of difference between the have 0% data-rate saving since its file size does not original and reconstructed image. change after reconstruction. The PNG file is not supported in Shutterfly.com.

Second, compute the average of mseRed, mseGreen and mseBlue.

Third, multiply the mseAverage to 1. Then divide the product to the product of m and n, where m is the number of vertical pixels and n is the number of Figure 3. Data-Rate Saving of the Test Data in PNG Format horizontal pixels. Figure 4 shows that Facebook.com has the highest data-rate saving based on its value of 78%. However, Imgur.com, Flickr.com, Photobucket.com, SmugMug.com, GooglePhotos.com and Tumblr.com have 0% data-rate saving since its file size does not Last, If MAXf is equal to 255 (using 8-bit image) change after reconstruction. The GIF file is not then supported in Shutterfly.com.

3.3 Interpretation The interpretation of the result is supported by what is stated in the literature - the higher the data-rate saving, the higher the data loss; the higher the mean square error, the higher the noise or error; and the higher the PSNR value, the greater the image compression used. IV. RESULTS AND DISCUSSIONS

The following figures and table provides the statistics Figure 4. Data-Rate Saving of the Test Data in GIF Format and comparison of all photo sharing sites according to data-rate saving, MSE and PSNR values. Figure 5 shows that Facebook.com has the highest Figure 2 shows that Imgur.com has the highest data- data-rate saving of 93% while GooglePhotos.com has rate savings based on its value of 66%. However, the lowest data-rate saving of 0%. Flickr.com, Photobucket.com, Shutterfly.com, SmugMug.com, GooglePhotos.com and Tumblr.com

Comparative Study on the Image Compression of Photo Sharing Sites using Mean Square Error, Peak Signal to Noise Ratio and Data-Rate Savings

116 International Journal of Electrical, Electronics and Data Communication, ISSN: 2320-2084 Volume-5, Issue-6, Jun-2017 http://iraj.in

CONCLUSION

The study showed how to compare various photo sharing sites using the equation of peak signal to noise ratio and mean square error to determine which site provides better quality picture. It also showed how to determine which site has better compression rate through data-rate saving equation. Base on the data, there are sites with better image quality representation based on its MSE value of 0db Figure 5. Data-Rate Saving of the Test Data in BMP Format however these sites also have 0% compression rate Table 4 shows the MSE and PSNR of the base on its data-rate saving value. For these reasons, reconstructed images from various photo sharing the researchers concluded that the data-rate saving of sites. Based on its MSE value for JPG format, results a compressed image is directly proportional to the have shown that apart from Facebook.com and value of MSE. If the data-rate saving of a site is Imgur.com, the remaining sites did not produce lower than the other site, therefore the MSE value is noise. also lower than the other site. If the data-rate saving As for the PNG and GIF files, among the 8 sites only of a site is high then the level of noise in the the downloaded image from Facebook.com produced reconstructed image is also high. In addition, it was noise. observed that the photo sharing site with the highest For the BMP file, the downloaded images from distortion or noise base on its MSE value have low Photobucket.com and GooglePhotos.com. have zero PSNR value. For these reason, the researchers MSE value (noise). concluded that MSE is indirectly proportional to the value of peak signal-to-noise ratio (PSNR). If a site Table 4 Summary Results of Computed PSNR and MSE using has low MSE value, you can expect that this site has the downloaded images from various Photo Sharing Sites high PSNR value. Thus, if a site has high MSE value, therefore the quality of image representation is low. In summary, no photo sharing site can provide better quality pictures without sacrificing the time it takes to upload and download pictures because as what the researchers concluded earlier, the data-rate saving is directly proportional to MSE and MSE is indirectly proportional to PSNR.

REFERENCES

[1] Asolkar, P., Zope, P., and Suralkar, S. 2013. Review of Data Figure 6 shows among Facebook.com, Imgur.com Compression and Different Techniques of Data Compression. and Flickr.com, when using BMP format, Imgur.com International Journal of Engineering Research and Technology, Page 1-2. has better image compression based on its PSNR [2] Baguley, R. n.d. The 10 Best Photo Syorage and Sharing Sites. value of 37.4db and MSE value of 11.8db. It is also Retrieved January 5, 2017, from evident in the figure that Flickr.com has the largest http://www.tomsguide.com/us/pictures-story/839-best- photography-sites.html#s14 distortion level of 36db compared to Imgur with [3] Techlicious. n.d. Best Photo Sharing Sites. Retrieved January 5, 11.8db and Facebook with 35.7db. 2017, from http://www.techlicious.com/guide/best-photo- sharing-sites/ [4] Bose, S., Madhulika, H., and Acharjee, S. 2014. Effects of Watermarking in Vector Quantization Based Image Compression. Institute of Electrical and Electronics Engineers, ISBN: 978-1-4799-4190-2. DOI: 10.1109/ICCICCT.2014.6993014. Page 1-2. [5] Center, I. H. n.d. Privacy Policy Important Update. Retrieved December 6, 2016, from https://www.instagram.com/about/legal/privacy/ [6] Collet, Y., & Turner, C. n.d. Smaller and Faster Data Compression with Zstandard. Retrieved December 6, 2016, from https://code.facebook.com/posts/1658392934479273/smaller- and-faster-data-compression-with-zstandard/ Figure 6. Computed MSE and PSNR of Downloaded Images in BMP Format

Comparative Study on the Image Compression of Photo Sharing Sites using Mean Square Error, Peak Signal to Noise Ratio and Data-Rate Savings

117 International Journal of Electrical, Electronics and Data Communication, ISSN: 2320-2084 Volume-5, Issue-6, Jun-2017 http://iraj.in [7] Hill, L. 2013. Can you upload tiff files to Facebook? Retrieved Scientific and Research Publications, ISSN 2250-3153. December 5, 2016, from Volume 3. Page 1-2. https://www.dpreview.com/forums/post/50898632 [17] Sayood, K. 2006. Introduction to Data Compression. San [8] Huynh-Thu, Q., & Ghanbari, M. 2012. The Accuracy of PSNR Fransisco, CA 94111: Elsevier. in Predicting Video Quality for Different Video Scenes and [18] Sonka, M., Hlavac, V., and Boyle, R. 2015. Image Processing Frame Rates. Telecommunication System, Page 1-2. Analysis and Machine Vission 4th Ed. US: Cengage Learning [9] Lasya, K. n.d.. Best 2 + Top Photo Sharing Sites List 2016. Inc. Retrieved December 5, 2016, from [19] Tierney, L. 2015. The Psychology Behind Why We Share on http://www.alltop9.com/best-photo-sharing-sites-list-2016/) Social Media. Retrieved December 5, 2016, from [10] Li, Z., and Drew, M. 2004. Fundamentals of Multimedia. US: https://www.shutterstock.com/blog/the-psychology-behind-why- Pearson Education Inc. we-share-on-social-media [11] MathWorks. n.d. Retrieved December 6, 2016, from [20] TrendingTopMost. 2017. Top 10 Most Popular Best Photo https://www.mathworks.com/help/images/image-quality- Sharing Websites 2017. Retrieved January 10, 2017, from metrics.html. http://www.trendingtopmost.com/worlds-popular-list-top- [12] Merriam Dictionary. n.d. Retrieved December 7, 2016, from 10/2017-2018-2019-2020-2021/best-blogs-websites/best- https://www.merriam-webster.com/dictionary/social%20media. photo-sharing-websites-free/ [13] Mu, W., Gao, J., Jiang, H., Chen , F., Gao, Z, and Chen, K. [21] Tutorialspoint. n.d. Concepts of Bits per Pixel. Retrieved 2013. Measuring Technology and Mechatronics Automation. December 6, 2016, from Fifth International Conference, DOI: https://www.tutorialspoint.com/dip/concept_of_bits_per_pixel. 10.1109/ICMTMA.2013.19. Page 1-2. htm [14] Myers, L. 2014. How to Optimize Photos for Facebook. [22] Veldhuizen, K. 1998. Retrieved December 5, 2016, from Retrieved December 5, 2016, from http://homepages.inf.ed.ac.uk/rbf/CVonline/LOCAL_COPIES/ http://louisem.com/1730/how-to-optimize-photos-for-facebook VELDHUIZEN/node18.html [15] National Instruments. 2013. Retrieved December 5, 2016, from [23] W3C.org. n.d. Graphics. Retrieved December 7, 2016, from http://www.ni.com/white-paper/13306/en/ https://www.w3.org/Graphics [16] Prabhu, B. 2013. PSNR Analysis for MDC Based Video Streaming Over Peer-to-Peer Networks. International Journal of



Comparative Study on the Image Compression of Photo Sharing Sites using Mean Square Error, Peak Signal to Noise Ratio and Data-Rate Savings

118