Quick Fixes

Free Software, Writing and other Stuff

Free CultureOpen DataSoftware

JPEG is Dead… Long Live BPG!

Fabrice Bellard has just introduced the BPG (Better Portable Graphics) format to the world, an image format that achieves amazing quality at a fraction of the size of prior formats.

The BPG format is a lossy format, i.e., some information is lost in the compression of the image, but it achieves higher quality than the ubiquitous JPEG (also a lossy format), probably the most used image format today. Like PNG, BPG also supports alpha, that is, transparent or semi-transparent pixels, but, again, with much higher compression ratios, making for much smaller files with similar quality.

As PNG, this image weighs of 41,000 bytes. As a BPG, only 6,000.
As PNG, this image weighs of 41,000 bytes. As a BPG, only 6,000.

This is a big deal because it will cut loading times drastically on graphic-heavy sites (who wouldn’t want their website to load in a fraction of the time and with better quality images?) and will save immense amounts of space on servers. Check out, for example, the image on the left: as a PNG with a transparent background, it weighs over 41,000 bytes. As a BPG with, no apparent loss in quality, only 6,000.

JPEG on the left, BPG on the right. To all practial effects, they way the same.
JPEG on the left, BPG on the right. To all practial effects, they way the same.

To best see how good BPG is, have a look at the several comparisons online. Pay special attention to backgrounds and gradients, and the difference in file sizes to see how BPG is vastly superior to all existing formats. Especially interesting is the interactive comparer pictured right. You can use it to compare different formats with different levels of compression. In the example shown, on the left of the white line you can see the JPEG with a high compression, resulting in very visible artifacts (look carefully at the sky). On the right is the BPG equivalent, with hardly any artifacts and weighing less than a kilobyte more.

As this a very new format, there is still no official support for BPG. What the sites that show BPG are doing is loading a JavaScript program into your browser and that is what is translating the BPG data into a viewable image. As (or “if”) this format becomes popular, hopefully browsers will integrate BPG rendering natively, making loading times even shorter.

Fabrice Bellard, the creator of the BPG format, has a long history of creating amazing things. He developed the ffmpeg program, a command line video encoder, converter, recorder and server, that also works as the back-end to many other conversion programs and players. He is also responsible for Qemu, a highly efficient virtual machine system that made its way into the Linux kernel and is the basis for many modern virtual machine technologies. In his free time he enjoys goofing around calculating decimal digits of Pi.

What a guy.

BPG is a free and open format. The encoding and decoding algorithms are distributed under LGPL and BSD licenses.

Cover Image: Picture Frames by anitab0000 on freeimages.com.

Have you developed a new and open file format? Get it funded on Pling and start building support.