BETA
This is a BETA experience. You may opt-out by clicking here

More From Forbes

Edit Story

Half The Size Of JPEG: Could BPG Lead To A Double-Speed Web?

Following
This article is more than 9 years old.

A new graphics file format, proposed by programmer Fabrice Bellard, could cut the file size of digital photos by half with far-reaching consequences.

How are images made smaller?

The vast majority of photos taken with a cameras or smartphones and nearly every image viewed on the Web is stored in the Joint Photographic Experts Group (JPEG) format.

Created in 1994 from work started in 1986, JPEG offers a practical way to take a still image and compress it into a file many times smaller than the original with minimal impact on image quality. Creating smaller files speeds up the transfer of images, such as when viewing web pages, and reduces the amount of storage required to hold them.

The JPEG standard is under continuing refinement as new features are added and compression algorithms are improved, but Bellard’s technique delivers a huge leap in compression performance.

His new format, dubbed Better Portable Graphics (BPG), generates much higher quality images than JPEG for any given size of file.

But, rather than improving on JPEG, BPG abandons it entirely, instead using a subset of a newer algorithm called High Efficiency Video Coding (HEVC), which is an open-source standard designed primarily for video compression. Using this technique, BPG achieves roughly double the compression of JPEG, so a similar level of quality to JPEG can be achieved while creating a file of only half the size.

Half the size of JPEG - everybody saves money

This means picture-heavy web images could display at double speed, while a phone or camera could store twice as many images before it becomes full. Metered data allowances would allow for considerably more web browsing with lower data caps.

These advantages translate directly into tangible economic gains which increase with the scale of implementation. Users could get by with slower broadband connections, cheaper phones and pay less for their mobile web browsing. Huge websites could save even more, thanks to reduced storage and bandwidth costs.

Better quality images

HEVC, and hence BPG, also adds features not supported by JPEG, including greater dynamic range by increasing the maximum number of bits per pixel from 8 to 14 and adding support for transparency. It also allows for lossless compression modes where an exact copy of the original can be generated with no loss of quality.

You can use this interactive viewer to compare the quality of BPG against several other file formats at various sizes.  The differences are most apparent when the file size is set to “tiny” and both algorithms are applying the most severe compression. The viewer displays a split left/right image where each side of the screen contains an image of equivalent size. You can move the split point with your mouse to compare the quality of each file format.

From these examples, we can see that BPG clearly outperforms the highly efficient “mozjpeg” format (of which more is written below).

Could BPG become the new standard?

Despite the obvious performance gains of BPG, it’s unlikely to become a new standard image format, the problem being one of compatibility.

With almost no existing software currently supporting the BPG format, it would take a lot for it to gain widespread popularity. Bellard provides a small Javascript decoder which can be added to websites to allow the use of BPG files in most current browsers immediately, but end users would have no other means of viewing or creating the files unless the format were to gain pervasive support in general applications.

Others are also working on smaller formats

Furthermore, Bellard is not the only one looking to improve upon JPEG and not the only one trying out HEVC for still images.

More recently, in March 2014, Mozilla Research, the research arm of Mozilla Foundation, creators of the Firefox browser, announced the “mozjpeg” project.

The aim of mozjpeg is to increase the compression performance of JPEG encoding while maintaining compatibility with existing picture viewing software.

On the Mozilla Research blog, Josh Aas, Senior Technology Strategist at Mozilla Corporation, writes

Production JPEG encoders have largely been stagnant in terms of compression efficiency, so replacing JPEG with something better has been a frequent topic of discussion. The major downside to moving away from JPEG is that it would require going through a multi-year period of relatively poor compatibility with the world’s deployed software. We (at Mozilla) don’t doubt that algorithmic improvements will make this worthwhile at some point, possibly soon. Even after a transition begins in earnest though, JPEG will continue to be used widely.”

There is certainly demand for better image compression: On July 15th 2014, mozjpeg 2.0 was announced, along with a $60,000 donation from Facebook which is testing the use of mozjpeg to improve the compression of images on the social media site.

BPG produces much smaller images than mozjpeg 2.0, but implementing it on site the size of Facebook.com with current browser software would be a compatibility nightmare as every application used to access the site would require additional code. However, adding support to Facebook’s own apps could be rather more feasible.

Conclusion - HEVC is the future

The mozjpeg team, among others, are also looking into the use of HEVC for image compression and test results show it to be one of the most promising contenders for a future universal image format.

BPG is available to try right now and is a great piece of work, but I expect any eventual still image format based on HEVC will need to carry the weight of a standards body such as the Joint Picture Experts Group itself.