Better Portable Graphics

In what could be really good news for photographers, French programmer Fabrice Bellard has come up with a greatly improved new compression format for images which he has named BPG for (Better Portable Graphics.)

Making use of ‘a subset of the HEVC open video compression standard‘, it offers significant advantages over the JPEG format that has been the standard compressed graphics format for many years, in particular supporting up to 14 bits per channel and giving a greater dynamic range and better compression ratio. For equivalent quality it gives much lower file sizes, though for most of us it will be the ability to get much higher quality at around the same file sizes that will probably be of more interest.

Bellard has deliberately chose to support the same chroma formats as JPEG, to reduce losses in conversion from (and to) JPEG, and the format also supports an alpha channel and RGB, YCgCO and CMYK colour spaces. The format can also include EXIF, ICC profile and XMP.

Gizmag has a nice image gallery which compares the two formats, concluding “The BPG files seem to hold up vastly better, demonstrating a lot less color banding, blocking and step-ladder aliasing along edges, and producing pleasing images down to surprisingly small sizes.” You can also see some good examples at Imaging Resource.

The weakness of BPG which Gizmag points out is that it makes use of the HEVC open video compression standard, of which, as Bellard states, some “algorithms may be protected by patents in some countries“. The whole legal position over this and other MPEG-related technologies  is unclear.

Also muddying the water is Google’s WebP format which they have made freely available under a BSD licence. Although clearly from the on line comparative examples inferior to BPG in image quality, it’s hard to compete with Google. But perhaps on seeing the advantages Google will want to run with BPG – so long as any patent problems can be surmounted.

At the moment BPG is not supported by browsers, but you can download source code, windows command line PNG or JPG to BPG encoder and BPG to PNG or PPM decoder, as well as javascript decoders for use on web sites which take pixel width and height from <img> tags to produce a canvas into which a BPG is decoded.  So in theory you could start using BPG on your web site today.

Of course this is all rather experimental stuff, and few will wish to take it up. But as the number of photographers now working with RAW images shows, many photographers are aware of the deficiencies of the jpeg format, useful as it has been over the past more than 20 years. With the increasing importance of video in cameras, the use of the H.264 video codec for both video and still images might make BPG a sensible alternative for camera manufacturers. JPEG arrived just in time to make images viable on the web, but it now seems time to move on – and BPG seems the best direction to take.

Leave a Reply

You must be logged in to post a comment.