|Mozjpeg 2 Makes Pictures Smaller|
|Written by Ian Elliot|
|Thursday, 17 July 2014|
Do we need a new image format? Mozilla thinks not and getting better performance is all a matter of using what we have better.
Back in March this year we reported on Mozilla's project to make JPEG better - Mozilla Wants To Take A Byte Out Of JPEGs. This seemed an unlikely project because Google already has WebP as its candidate replacement for JPEG across the entire Internet and JPEG has been around a long time. If it was possible to make JPEG better then presumably it would have been made better.
The key to the approach is that JPEG defines a standard for decompression and there is much more freedom in how the compression is performed. Basically as long as a JPEG file conforms to the standard it doesn't matter how it was created.
The first version of mozjpeg achieved some improvements for progressive JPEGs, but not for standard JPEGs. Now Mozilla has released mozjpeg version 2 and this provides an improvement of 5% smaller storage for the same quality of image. The new approach uses trellis quantization. This optimizes the way the coefficients of the DCT used in JPEG are quantized so as to provide the lowest distortion ratio.
Mozjpeg is based on libjpeg-turbo, which is the standard open source JPEG library. The advice is that you should use libjpeg-turbo for your offline JPEGs, but use mozjpeg for web use so as to maximize page loading speed.
What might come as a surprise is that Facebook is not only testing mozjpeg but is also providing a donation of $60,000 to see is there is an even better mozjpeg 3 waiting to be produced.
Another point is that what you consider to be "the same quality" depends on the judgement of quality. Google's WebP is claimed to be 40% smaller at the same quality but Mozilla's team have found that it depends on the measure of image quality you use. For some measures WebP and JPEG XR performed better than mozjpeg, but worse on others.
Overall the conclusion is that the alternative formats are no better than traditional JPEG performing at its best and with no need to change the decoders. The new version of mozjpeg also has options to compress the image to give the best results on a range of standard image quality measures.
Mozjpeg is open source and is permissively licenced compared to say HEVC-MSP, the still version of H.264, which is subject to the same mess of patents and licencing.
As pointed out in the previous news report, the real problem with JPEG is that most users don't attempt to optimize it. JPEG encoders tend to be used at a fixed compression setting, usually the default for the graphics package processing the image. A better user interface that showed the user what a range of compressed images looked like in an effort to optimize the file size would probably save more than 5% on a typical JPEG.
To be informed about new articles on I Programmer, install the I Programmer Toolbar, subscribe to the RSS feed, follow us on, Twitter, Facebook, Google+ or Linkedin, or sign up for our weekly newsletter.
or email your comment to: email@example.com
|Last Updated ( Thursday, 17 July 2014 )|