Compress JPEG image more than 2 GB by "mozjpeg 2.0" compressing more than 2 GB image files
The project "mozjpeg", which is under development of codec with the goal of further increasing the compression ratio of JPEG images and reducing the traffic load of the entire net, attracts attention.Facebook fundsIt has also been reported that it did. It will be its latest version in July 2014 "Mozjpeg 2.0"Was released, but realizing high speed by distributing the load of the web serverContent delivery network(CDN) serviceCloudFlareHas investigated the performance of mozjpeg 2.0 and released it on its blog.
Experimenting with mozjpeg 2.0 | CloudFlare Blog
For CloudFlare users who use pay-as-you-go CDN service "Polish"We offer image optimization services called. Although its purpose is to reduce the size of the image data of course to reduce the load on the server and improve the transfer speed, CloudFlare focused on the performance of Mozjpeg 2.0 the other day when making Polish a new version, We are comparing benchmarks.
In verification, as a conventional codecLibjpeg-turboAnd mozjpeg 2.0 which is the latest codec are used to optimize processing by randomly extracting 10,000 files from image files stored in CloudFlare for verification. The average size of each file is 256 KB, and the total size has reached 2,564, 135,285 bytes (about 2.39 GB). The following commands were used.
Comparing the number of files that failed to process without reducing the file size even after processing, libjpeg-turbo3471In the case of ozjpeg 2.0 versus file691It turned out that it was clearly less than the file, and high compression ability of mozjpeg 2.0 was highlighted. Also, the average compression ratio of files that could be compressed by both codecs is mozjpeg 2.03.0%, In the case of libjpeg-turbo2.5%It has become obvious that it was also, here also the outstandingness of mozjpeg 2.0 stands outstanding.
As an example, when compressing the following file (clicking with the original file display) with both codecs, the original file's capacity was 1,984,669 bytes (about 1.89 MB), whereas after compressing with libjpeg-turbo, 1,956,200 bytes (About 1.87 MB2.4% decrease), And in mozjpeg 2.0, 1,874,491 bytes (about 1.79 MB5.6% decrease), And mozjpeg 2.0 proves that the compression ratio was 4.0% higher.
The following chart shows the compression ratio of all files processed with mozjpeg 2.0 in percent for each graph. It is shown that the files which realized the compression rate less than 2% to less than 3% were the most frequent.
However, it is also true that some "sacrifice" has occurred in order to achieve high compression ratio, and libjpeg-turbo takes time to process all the files273 secondsWhereas mozjpeg 2.0474 seconds, It turned out that it took about 1.7 times longer.