Feeds

Your 'funny' cat pics are weighing down the web, so here's a better JPEG encoder from Mozilla

Claims to reduce file sizes by 10 per cent

New hybrid storage solutions

Mozilla has announced a new open-source JPEG encoding library, which it says could significantly reduce the amount of network traffic used by the web.

Dubbed "mozjpeg," the library incorporates image-shrinking algorithms from the public domain JPEG-optimizing utility jpgcrush into the encoder itself, resulting in images that are smaller than those produced by most other JPEG encoders at the same quality levels.

Because images are typically much larger than HTML, CSS, or JavaScript files, it follows that images take up most of the bandwidth consumed with each web page load. And on today's web, "images" generally means JPEG files.

"Nearly every photograph on the Web is served up as a JPEG," Mozilla technology strategist Josh Aas said in a blog post.

Reducing the bandwidth burden of the web by shrinking the size of images has been a perennial topic of discussion among web developers. But most attempts at solving the problem have involved replacing JPEG with some new, more efficient image format.

Google's WebP format, for example, claims to be able to shrink JPEG, GIF, and PNG images by an average of 39 per cent, without any perceptible loss of image quality.

The problem with this approach, however, is that before major content sites adopt a new format for their images, they have to be sure it will be supported by the majority of web browsers.

In the specific case of WebP, while Chrome and Opera can already decode the format natively, Firefox, Internet Explorer, and Safari can't – at least, not without workarounds.

But all browsers support JPEG images, so by producing a more efficient JPEG encoder, Mozilla is hoping to give web developers some of the benefits of alternatives like WebP while avoiding the backward-compatibility problem.

"Given this situation, we wondered if JPEG encoders have really reached their full compression potential after 20+ years," Aas wrote. "We talked to a number of engineers, and concluded that the answer is 'no,' even within the constraints of strong compatibility requirements."

For mozjpeg, Mozilla has forked the hardware-accelerated JPEG encoding library libjpeg-turbo and baked in algorithms from jpgcrush, which shrinks images by comparing various progressive encoding configurations and picking the one that produces the smallest output.

Mozilla says the new library can reduce the size of JPEGs by an average of 10 per cent, based on a sample of 1,500 images downloaded from Wikimedia – hardly as much as WebP, but still a meaningful savings.

For the next version of the library, Aas said Mozilla plans to implement trellis quantization, an algorithm that should reduce image sizes even further.

Mozilla has made the source code to mozjpeg available on Github under a BSD-style open source license. Developers who are interested in contributing to the project are invited to join the newly created mailing list. ®

Reducing the cost and complexity of web vulnerability management

More from The Register

next story
New 'Cosmos' browser surfs the net by TXT alone
No data plan? No WiFi? No worries ... except sluggish download speed
'Windows 9' LEAK: Microsoft's playing catchup with Linux
Multiple desktops and live tiles in restored Start button star in new vids
iOS 8 release: WebGL now runs everywhere. Hurrah for 3D graphics!
HTML 5's pretty neat ... when your browser supports it
'People have forgotten just how late the first iPhone arrived ...'
Plus: 'Google's IDEALISM is an injudicious justification for inappropriate biz practices'
Mathematica hits the Web
Wolfram embraces the cloud, promies private cloud cut of its number-cruncher
Mozilla shutters Labs, tells nobody it's been dead for five months
Staffer's blog reveals all as projects languish on GitHub
SUSE Linux owner Attachmate gobbled by Micro Focus for $2.3bn
Merger will lead to mainframe and COBOL powerhouse
iOS 8 Healthkit gets a bug SO Apple KILLS it. That's real healthcare!
Not fit for purpose on day of launch, says Cupertino
Not appy with your Chromebook? Well now it can run Android apps
Google offers beta of tricky OS-inside-OS tech
prev story

Whitepapers

Secure remote control for conventional and virtual desktops
Balancing user privacy and privileged access, in accordance with compliance frameworks and legislation. Evaluating any potential remote control choice.
WIN a very cool portable ZX Spectrum
Win a one-off portable Spectrum built by legendary hardware hacker Ben Heck
Intelligent flash storage arrays
Tegile Intelligent Storage Arrays with IntelliFlash helps IT boost storage utilization and effciency while delivering unmatched storage savings and performance.
High Performance for All
While HPC is not new, it has traditionally been seen as a specialist area – is it now geared up to meet more mainstream requirements?
Beginner's guide to SSL certificates
De-mystify the technology involved and give you the information you need to make the best decision when considering your online security options.