Categories: SoftwareWorkspace

Mozilla Explores Faster Web Loading With Mozjpeg Encoder

The Mozilla Foundation is seeking to improve the loading speeds of web pages with the launch of its ‘Mozjpeg’ Project.

The aim of the project is to “provide a production-quality JPEG encoder that improves compression while maintaining compatibility with the vast majority of deployed decoders.”

Better Compression

The project has developed a faster JPEG encoder that claims to to reduce file sizes by up to 10 percent on standard JPEG images.

JPEG is the most commonly used photography and image format used on the Internet (ahead of GIF and PNG files). Indeed, the file format is also one of the most commonly used by all types of software, including Microsoft Office and Adobe Photoshop. So anything that can be done to reduce the size of JPEG images could dramatically improve loading times of web pages.

“JPEG has been in use since around 1992,” explained Josh Aas, a senior technology strategist at Mozilla Corp, in a blog post. “The number of photos displayed by the average Web site has grown over the years, as has the size of those photos. HTML, JS, and CSS files are relatively small in comparison, which means photos can easily make up the bulk of the network traffic for a page load. Reducing the size of these files is an obvious goal for optimization.”

But according to Aas, production JPEG encoders have largely been stagnant in terms of compression efficiency. So the Foundation talked with a number of engineers to see if JPEG encoders have really reached their full compression potential after 20+ years.

Faster Loading

“We concluded that the answer is ‘no,’ even within the constraints of strong compatibility requirements,” Aas wrote. “With feedback on promising avenues for exploration in hand, we started the ‘mozjpeg’ project.”

Mozilla has therefore released version 1.0, which is a fork of libjpeg-turbo (a popular open-source JPEG codec) and combined it with ‘jpgcrush’ (a popular Perl script). Mozilla said it can now reduce file sizes, typically by 2-6 percent for PNGs encoded to JPEG. However with average JPEG file sizes, it achieved an average 10 percent reduction using a sample of 1,500 JPEG files from Wikimedia.

“It does this by figuring out which progressive coding configuration uses the fewest bits,” said Aas. “So far as we know, no production encoder has this functionality built in, so we added it as the first feature in ‘mozjpeg’.”

And the next step is to improve the encoding by making use of ‘trellis quantization‘, which is an algorithm that is typically used for video compression purposes.

The news that Mozilla is seeking to improve the loading speeds of web pages will be welcomed by many Internet users around the world. Less welcome news however is Mozilla’s intent to incorporate advertising to its Firefox web browser, through a new feature called ‘Directory Tiles’, which will replace some of the empty tiles which appear when opening a new tab.

Are you a Firefox enthusiast? Take our quiz!

Tom Jowitt

Tom Jowitt is a leading British tech freelancer and long standing contributor to Silicon UK. He is also a bit of a Lord of the Rings nut...

Recent Posts

Google Delays Removal Of Third-Party Cookies, Again

For third time Google delays phase-out of third-party Chrome cookies after pushback from industry and…

34 mins ago

Tesla Posts Biggest Revenue Drop Since 2012

Elon Musk firm touts cheaper EV models, as profits slump over 50 percent in the…

1 hour ago

Apple iPhone Q1 Sales In China Fall 19 Percent, Says Counterpoint

Bad news for Tim Cook, as Counterpoint records 19 percent fall in iPhone sales in…

5 hours ago

President Biden Signs TikTok Ban Or Divest Bill Into Law

TikTok pledges to challenge 'unconstitutional' US ban in the courts, after President Joe Biden signs…

7 hours ago

UK CMA Seeks Feedback On Microsoft, Amazon AI Partnerships

British regulator invites feedback on major partnerships Microsoft and Amazon have struck with smaller AI…

23 hours ago

Google Fires More Staff Over Israel Protest

Another 20 staff have been fired by Google over Israel protest and their “completely unacceptable…

24 hours ago