back to article QEMU, FFMPEG guru unleashes JPEG-slaying graphics compressor

Noted software wizard Fabrice Bellard has devised a new raster image format that he says offers superior quality to JPEG at similar file sizes. Bellard – who is known for creating the QEMU virtualization hypervisor and the FFMPEG multimedia libraries, among other achievements – says the new format, called Better Portable …

  1. Christian Berger

    It's probably not what the web needs urgently...

    ...as image loading times aren't a problem any more, loading the stopgap javascript code probably takes longer than loading a couple of images over a connection that's already established.

    However I'm sure it has lots of uses in various places. So I'd first establish it somewhere else, and once it's integrated into graphics libraries, we can start using it in browsers. One problem with browsers is also that some are unlikely to get updates.

    1. Anonymous Coward
      Anonymous Coward

      Re: It's probably not what the web needs urgently...

      Actually, this is just what GUi's need all inclusively. People have just become used to what Microsoft deemed good enough nearly 20 years ago. Yes, it's Microsoft's fault were stalled on 8-bit.

      The graphics in all things need to keep going. I'm not saying I need to keep moving along with them, but they should keep going. SGi (god rest their business), was attempting 16-bit colour 20 years ago, while Microsoft was just too damn arrogant to incorporate their technologies. Adobe too is responsible (but that's a real rant).

      Anyways, higher quality graphics should always be on somebodies plate. I'm sitting behind a 10-bit NEC monitor running in 8-bit mode, and due to the larger gamut alone I notice the difference. I'm not a graphics whore, hell I'm not even a serious gamer, but better graphics are something I always want to see. And given the latest state of graphics, well, I'm just not impressed at all. What people call "amazing" coming from their Titan's I call "dated". Dated because a long, long, long time ago as a kid, I would of thought graphics would be much, I mean MUCH farther ahead.

      If SGi hadn't died by the strangle hold of Microsoft's lack of "playing nicely with others", graphics could be, or even would be running in 24-bit mode right now by default. If I wasn't exposed to what SGi was trying to do, and even pulling off 20 years ago, maybe then I wouldn't realize just how far back graphics have been set due to Microsoft's "True Color" bullshit, Adobe too (who REALLY gives a fuck about your fonts man!)

      Sorry, a lot of built up concern on this topic :-/

      1. -tim

        Re: It's probably not what the web needs urgently...

        When I had access to a full 24 bit frame buffer in the mid 1980s, I decided to see just how many of the 16 million colours were useful. It turns out that there are less then 200 oranges and even less if you ask "is this brown or orange?" About 8 million of the colours are greys or browns and only about 4 million of the colours result in people being able to name the colour such as "that is a blue".

        Later I found out that if you use Gray Code for pictures, they existing gif and jpg libraries would make the images much smaller will less loss.

        The oddest thing I found was when we scanned a poster of The Starry Night, our edge detection software found a different picture so either we detected the picture that went through the printting press before so someone should x-ray van Gogh's work.

      2. Christian Berger

        Re: It's probably not what the web needs urgently...

        Well improvements are always good, but we need to be careful when an improvement greatly increases complexity. Going from 8 to 16 bit colour depth doesn't add much complexity, at most you need a lookup table or a function to translate the pixel values. That may be acceptable when dealing a lot with images. However this is completely new code and image decompression code has had security issues before. So I'd say we should first give it a bit of a shake down, and use it wherever we actually need it now.

      3. A Known Coward

        Re: It's probably not what the web needs urgently...

        Sorry but I'm going to keep using PNGs for my GUIs, after all to actually display them they all need decompressing to bitmaps at which point they consume identical amounts of memory. Anyone who uses JPEG for a GUI is just sacrificing fidelity for the sake of saving a small amount of disk space.

        It will be interesting to see how well the lossless option of BPG works in comparison to PNG. I note that's not one of the comparisons they do on the website.

      4. Fluffy Bunny
        Boffin

        Re: It's probably not what the web needs urgently...

        "Yes, it's Microsoft's fault were stalled on 8-bit."

        Actually, no. Microsoft adopted the standard of the time. And JPEG was a very good standard then, but you wouldn't want to try some of the stuff we do now on those old computers. A 90 MHz Pentium too 5 seconds to display a 640x480 JPG. It was only after 2000 that computers got the power to display standard resolution video.

        Later graphics standards, such as PNG, have improved the quality available. The relatively low uptake of these formats shows that JPEG does a sufficiently good job for most users.

    2. PleebSmash

      Re: It's probably not what the web needs urgently...

      What's more, the JavaScript code produces a horrible mess for me on Chrome: http://bellard.org/bpg/lena.html. It seems to work on Firefox though.

      1. Anonymous Coward
        Anonymous Coward

        Re: It's probably not what the web needs urgently...

        @PleebSmash

        I guess I'll have to read more about this, because all the pictures in your link seem to resolve as a .jpg in firefox. Is that how .bpg works, by resolving to a .jpg in your browser?

        Well, I downloaded the picture "lena30.jpg" and according to irfanview, it's a regular old .jpg (no alpha channel), so maybe that page is just a visual guesstimation?

        1. Anonymous Coward
          Anonymous Coward

          Re: It's probably not what the web needs urgently...

          Well, I downloaded the picture "lena30.jpg" and according to irfanview, it's a regular old .jpg (no alpha channel), so maybe that page is just a visual guesstimation?

          Yep, lena30.jpg IS a JPEG, for comparison purposes.

          The BPG is here: lena_q23.bpg, and in my browser, it gets replaced by a data URL which is a Base64-encoded PNG.

        2. Mystic Megabyte

          Re: It's probably not what the web needs urgently...

          If you are blocking javascript then you will only see the jpg images.

          It works fine in FF 34.0

        3. VinceH

          Re: It's probably not what the web needs urgently...

          "I guess I'll have to read more about this, because all the pictures in your link seem to resolve as a .jpg in firefox. Is that how .bpg works, by resolving to a .jpg in your browser?"

          Make sure you enable javascript on PleebSmash's link, otherwise what you will see are the JPEG files used for comparison with the BPG files.

          The BPG files themselves are rendered as PNG files: that's the point of the javascript decoder - to convert the BPG files, which the browser doesn't understand, into something it does.

          1. Anonymous Coward
            Anonymous Coward

            Re: It's probably not what the web needs urgently...

            Yep, it was javascript. Thanks everyone, I wasn't even paying attention to the block.

            BTW, this seems to make NoScript even more effective than before, which sort of makes me fear it's uptake. Of course .bpg's could be made an exception to NoScript, but by default would they be? I hope this is widely accepted, but being what I just experienced, it surely isn't better for advertising.

      2. Oninoshiko

        Re: It's probably not what the web needs urgently...

        works fine on crome for me.

        38.0.2125.111 m

        I am a little out of date though

      3. tony2heads

        @PleebSmash

        works fine on mine

        Version 39.0.2171.71 (64-bit) Linux)

  2. LaeMing
    Boffin

    Units sold?

    Does the units sold issue even apply to for-free software like Firefox?

    Was the units sold licensing from MPEGLA possibly worded like that to give for-free software an easy exemption?

    Curious to know.

  3. Anonymous Coward
    Anonymous Coward

    SImilar filesize but better quality than JPG but with an alpha channel? Do want. Hope it takes off.

    1. PleebSmash

      So it's an all-in-one JPEG and PNG killer (optional lossless).

      1. A Known Coward

        PNG Killer?

        Only if the file sizes and decompression speed are better than PNG, I can't find any comparisons on their website.

    2. Charlie Clark Silver badge

      Webp already does this (it's based on the OnVideo technology that Google bought and put into WebM) in much the same way (video compression has continue to develop while bitmap compression is stuck in the 1990s) but has the advantage of several years in the real world and browser support in Photoshop, Photoline, Chrome and Opera but strangely not Firefox although it supports the parent video format, and mod_pagespeed for http servers to optimise on the fly for browsers. Given their underlying similarities I wouldn't expect much difference between WebP and BPG in the quality/file size stakes.

      The interesting thing will be how the MPEG-LA patent cartel deals with this and whether anyone picks it up for hardware acceleration. Personally, I think Google's approach on the technology with a rapid release schedule for encoders is the way to go on this but if Bellard can keep the licence liberal (the MPEG-LA might want to have a word about that) then it should be a win-win.

      The Firefox library is nice enough but JPEG images always look worse than WebP at the same compression ratio.

    3. p3ngwin1

      "SImilar filesize but better quality than JPG but with an alpha channel"

      Google's WebP already supports that, *and* GIF, and lossless, and adaptive animation (per frame independent compression!)...and more.

      WebP combines the best parts of Lossy, lossless, animated, alpha, and more all into a single format.

      why the hell would we focus on narrowing the formats into individual codecs again ?

      1. P. Lee

        > why the hell would we focus on narrowing the formats into individual codecs again ?

        Because using hardware skirts the royalty issue and enables free software to use it?

        That would be my guess, though I hate the idea of setting standards in stone (literally - silicon).

        Plus, what's the likelihood of Apple and MS supporting a Google format - even a free one?

  4. JustNiz

    So in short it doesn't stand a chance then, since in any format war, it's always the best technical solution that loses.

  5. fnj
    Happy

    Love it

    A stunning improvement. Never mind smaller but same quality - dig the massive improvement in quality for the same size.

  6. SineWave242

    Gimme. :) Really, aside from PNG every other image format looks bad. Especially JPEGs. But it does make me wonder what happened to JPEG2000? But I do understand that possibly JPEG2000 doesn's support more than 8-bit colours. I wouldn't know.

    1. Androgynous Cupboard Silver badge

      JPEG2000

      JPEG2000 supports just about everything. It's f***ing nightmare of options - from memory there are about 16 different types of ColorSpace, although only about 8 in baseline. It's patented up the wazoo too. To make matters worse, the only public Java implementation (which has been repackaged several times) is the single worst piece of Java code I have ever had the misfortune to wade into. Some of the many reasons it didn't take off.

      1. Anonymous Coward
        Thumb Up

        Re: JPEG2000

        JPEG2000 supports just about everything. It's f***ing nightmare of options - from memory there are about 16 different types of ColorSpace, although only about 8 in baseline. It's patented up the wazoo too.

        Pretty much everything except

        #include <stdio.h>

        int main(void) { printf("Hello World\n"); return(0); }

        is these days. We can't even be sure that this BPG hasn't got someone lurking in the shadows waiting for it to become popular before surprising us all with a few patent lawsuits. Even if they prove to be invalid: it's still expense defending.

        Sadly if we spent all our time checking for prior art, we'd be doing more tiptoeing around existing patents and very little genuine innovating. Projects like BPG are exactly what the industry needs, true innovation.

        The good news is that we can use this code today: there's a (albeit, slowish) decoder in JavaScript which allows backward compatibility in modern browsers. It took a long time to get rid of the HTML3 browsers that could only do GIF and JPEG… it'll be nice to use something other than PNG for high-fidelity graphics.

        1. Cliff

          Re: JPEG2000

          JPEG2000 lives happily in the niche of digital cinema packages - the modern equivalent of 35mm movie film prints are a string of JPEG2000's, one per frame, packaged with a soundtrack.

          1. GettinSadda

            Re: JPEG2000

            Actually, modern movie "prints" are actually a collection of MXF files with JPEG2000 images inside them.

  7. John Brown (no body) Silver badge
    Coat

    So is it just me....

    ...or did others initially look at the byte count and go "meh!". And THEN look at the image quality. And that's some pretty damn good quality for the byte count.

    Assuming it's not just me, does this suggest something about the new Reg site design? :-)

    Content is king :-)

  8. Alan W. Rateliff, II

    Adoption

    Page loading times may not be an issue for super-duper fast connections, but such an improvement means even faster loading times, seemingly instant. Meh, for some, but I can imagine mobile devices will benefit greatly from a high-quality, low byte-count image format. Especially mobile browsers like Opera Mini which reduce the quality of images to accommodate limited data packages.

    As for getting it out into the wild, while the landscape may be different today than when PNG was introduced, I remember using plug-ins for Netscape, Opera, and Internet Explorer for PNG to work. A Java plug-in is a start. Now we just see how long it will take for GIMP and IrfanView plug-ins.

    1. Eddy Ito

      Re: Adoption

      If the porn industry adopts it then it will be everywhere shortly thereafter. If porn peddlers don't, it's going to be a long slog.

      1. Crazy Operations Guy

        Re: Adoption

        What decade are you living in? The porn industry is 99% video now. The only sites that can survive with photos are the really niche-type sites (less than 0.1% of the market) and sites featuring stolen images.

  9. T. F. M. Reader

    Prety cool demo

    Bellard's page has a link to a pretty cool demo - I am surprised El Reg didn't give a link . The most obvious effect that I saw there is in smooth parts of pictures (not surprising - that is where I expect compression to do most of its work), such as the sky in the "Moscow" picture.

    Play with formats and file sizes (and check the "Original" format against the various options, and you may aso try to zoom in and out with the browser). You will find how close BPG is to Original even for small and tiny file sizes, and to what extent it blows away Mozjpeg and WebP.

    On images with smaller details all over, such as the internals of the Toledo Cathedral, I do not see much difference between formats. I guess such images are just difficult to compress with any algo.

    1. Charlie Clark Silver badge

      Re: Prety cool demo

      Cheers for the link. Don't agree with the statement that BPG blows away WebP: they're pretty close at the moment with one being better in one situation and another better in the other. At the moment BPG is definitely better for people, which is what will matter to most.

      It seems WebP is still based on On8 (the equivalent of H264 so the predecessor to H265). Anyone know if a move to On9 is planned?

      1. Eddy Ito

        Re: Prety cool demo

        I don't know on the several I tried it seems to me that BPG was consistently a bit better than WebP. I thought the Eaglefairy example was one of the most obvious as some stars simply vanish from the WebP version.

        1. Kristian Walsh Silver badge

          Re: Prety cool demo

          Diminishing returns set in once you get to the modern codecs, but there is not one of the sample images where the WebP image is of comparable quality. BPG is able to pull more detail out without the edge artefacts that mar the WebP images.

          For example, on the Alfa Romeo 6C picture, http://xooyoozoo.github.io/yolo-octo-bugfixes/#vintage-car&webp=s&bpg=s , the BPG image allows you to see that the maker's badge reads "ALFA ROMEO MILANO", while the WebP image has obscured the word "ROMEO" entirely. (WebP doesn't have the horizontal green ripple below the top of the car grille, but that's the only noticeable difference).

          At the other side of the frequency spectrum, BPG also excels is in its treatment of gradients and out-of-focus image areas, which is the weakest part of JPEG's block-based coder.

          In fairness to the JPEG committee, they were primarily working to solve the problems of the photographic printing industry within the computational constraints of the late 1980s - the longevity of JPEG JFIF is a testament to how good a job they did.

  10. Vociferous

    There's been many better formats than JPEG.

    None has taken off.

    I hope this will, but history says odds are against it.

    1. Anonymous Coward
      Anonymous Coward

      Re: There's been many better formats than JPEG.

      Patents will kill this just like they killed all the others.

      Patents need to go back to the 18th century where they belong.

    2. Suricou Raven

      Re: There's been many better formats than JPEG.

      JPEG is 'good enough' and firmly entrenched. The only way it's getting displaced is if a format comes along that is both technically superior (easy enough) and also has the backing of a party with major influence. BPG lacks the latter. WebP has it, barely - but Google isn't doing a great deal to promote their new format. If they threw some serious weight behind it, then it could get established. They could even try to get support from Microsoft and Apple - neither of those are trying to promote any competing image standard, so improved compression would be to everyone's advantage.

  11. Steve Foster
    Holmes

    Amazed this hasn't been posted already, but...

    ...obligatory XKCD.

  12. smoot

    licencing

    while always nice to see Lena, it isnt really the best choice for a good comparison (softened prepub and other issues). That said, I agree the licensing is the big issue to report on.

  13. MarkTheMorose

    If this means I can store more porn on my bulging hard drives, then I'm in favour. Otherwise, I'm not much bothered.

POST COMMENT House rules

Not a member of The Register? Create a new account here.

  • Enter your comment

  • Add an icon

Anonymous cowards cannot choose their icon