BPG Image format

(bellard.org)

368 points | by jhabdas 2097 days ago

20 comments

  • rudolfwinestock 2097 days ago
    Note that the author of the linked page is Fabrice Bellard. He created a PC emulator in JavaScript.

    https://bellard.org/jslinux/

    He's also made several other impressive hacks: https://bellard.org/

    • nailer 2097 days ago
      Just reiterating this. Same guy behind FFmpeg, QEmu. One of the living legends.
      • sofaofthedamned 2096 days ago
        The 4G/LTE stuff he did was amazing. We had a team of people at the extremely large network company I worked at previously who didn't get the same quality and coverage he managed.

        Does he do public talks? I'd love to see him and shake his hand for many, many reasons.

        • bborud 2096 days ago
          I would be interested to know why, in your opinion, the team at the large company couldn't achieve the same quality.
          • repolfx 2096 days ago
            Bellard is the sort of guy you makes you realise the 10x programmer meme is nonsense, it's really more like 100x.
          • sofaofthedamned 2096 days ago
            God knows. Some extremely smart people but we eventually gave up on developing our own 4g stack and bought one instead.

            To be fair his stack may not be as complete as the one we were aiming for, we spent a lot of time and money on the air interface.

      • joss82 2096 days ago
        Don't forget the decimals of pi record holder for a while (on a laptop)
      • nihil75 2096 days ago
        He must be stopped. Making the rest of us look bad.
      • Thisisneto 2097 days ago
        Don't forget the Tiny C Compiler (tcc). :)
      • ksec 2096 days ago
        And he doesn't work in any of the big tech companies. Mike Pall as well.

        I wonder why?

      • dvirsky 2096 days ago
        Probably number one on my list of top favorite open source developers.
      • shawn 2097 days ago
        Pointing this out discourages others from posting things to HN. Why bother posting your own stuff when you're not a legend?

        I've seen this in practice, so it's not theoretical. It's the main reason my friends don't even try.

        But the reason is more subtle than that. Say you made BPG. If you don't have past accomplishments, people will tear you to shreds here. Yet the comments are all "Look at what this genius has made."

        I'm trying, hard, to find a way to resist credentialism. A meritocracy is something I want to live in.

        Look, the reason I'm writing this comment is because my friend just gave up on open sourcing their amazing project. Why? Because incentives. I've been trying to convince him to MIT the code, but I can't say I blame him for keeping it closed. And part of the reason is that the only people who get paid for writing open source side project software are those high-profile genius types that we're lauding on HN.

        Credentialism. Reputation. Audience. These are harmful to a meritocracy. If you've made something good, no one should give a damn who you are or how many people like you.

        • mwfunk 2097 days ago
          The concept of reputation is harmful to a meritocracy? I don't agree with this at all. Your friend didn't want to open source his project because he was annoyed that he wasn't a famous hacker type who can get free publicity, so he didn't think he would get paid to work on it? That's not how this works. That's not how any of this works.

          Nobody gets torn to shreds on HN for showing people their project, people get torn to shreds for trying to use open source and HN as a cynical self-marketing tool, especially when they can't back it up with something cool and interesting. Open source doesn't exist to further the career or finances or reputations of open source authors, it's just a nice little miracle when it does.

          If someone makes something great, there's a teeny tiny chance it'll catch on to become widely used, and if that happens there's an even teenier, tinier chance that the creator will at some point get paid to work on it, but that's a tiny sliver of the open source world. If that's all your friend cares about, then the meritocracy is real and working. Someone who will only write open source to become rich and famous is clearly deeply confused about how and why any of this stuff exists in the first place, and until they grow up they can't be relied on to do good work for good reasons.

          However, there's a silver lining. If instead of becoming the next Linus, someone simply wants to steer their career towards working on open source professionally, that's awesome and commendable. There are lots of companies and government agencies and so on that pay people to work on open source projects as their day-to-day job. That doesn't take social capital or name recognition, that just requires getting a job in one of those organizations, which span the gamut from tiny startups, to giant companies like Google/Apple/Microsoft/etc., to government agencies like NASA. Tons of people get paid to work on open source if that's what your friend cares about.

          • shawn 2096 days ago
            What if you want to work for yourself? What if you want to start a startup? What incentives do you have to open source your software?

            We all rely on open source tools, but lately they're coming exclusively from large companies that can afford to develop it. And that should worry us. It means we're losing the control we used to have.

            In a scientific paper, the related work section doesn't present the past work of the authors, unless it's related to the topic at hand. There's a reason Ballard didn't mention himself (beyond signing the page at the bottom).

            • Benjamin_Dobell 2096 days ago
              > We all rely on open source tools, but lately they're coming exclusively from large companies that can afford to develop it.

              Do you have any evidence to support this?

              In the age of GitHub and social coding I would have thought that open source is more individuals, and less corporate (percentage-wise) than ever before.

              P.S. I work for my self and open source a fair bit. I tend to open source libraries rather than products, which is true for most companies. Facebook open source React, not Facebook.

            • mikekchar 2096 days ago
              If you were to take a time machine all the way back to 1984 and live through the birth of "Free software", you would recognise your arguments being echoed over and over and over again. And yet, it's easier to be a free software developer than it ever was. Good grief, there are companies that exist that will pay you a normal programmer's salary to write free software! There are people who write emails that say, "I've been writing X for the last 20 years and I just can't afford to do it any more" and suddenly they have people throwing money at them.

              Sure it's not everywhere, and sure I'd love it if more free software developers could afford to spend all of their time writing free software. That would be fantastic! But to say that it is worse now than it was previously? I'm afraid you are mistaken.

              The thing you have to understand is that "control" in free software is different than control with other software. The "eyes" have it. If you are able to coordinate enough development, and you aren't working against the community, and you are producing things that people want, then you will be successful. Yes, a company that offers to pay people to do these activities is at a huge advantage. I'm not sure in what universe that's a bad thing. But the point of free software is freedom. If I don't like what you are doing and I can convince enough people to go in another direction, then I am free to do so. In fact, I don't even need other people... I can just do it myself, although it will take longer.

              I don't know about you, but I choose to rely on tools that are free software. I'm not forced to do so. Although it is waaaaay easier than it used to be, I go out of my way to pick something that I know I can work on myself if I need to. Yes, I've read the code for both vim and emacs. I've written extensions. I've found bugs. I've fixed bugs in compilers, interpreters, desktop environments, the works.

              It wasn't that long ago that I was forced to use MS tools in order to receive my salary. I vividly remember phoning up support one day, "I'm having problems with X. I have a reproduction scenario here if you like". "How many seats do you have?" "Seats? We're a platinum partner. I don't know how many seats we use." "Do you have less than 1,000 programmers there?" "Uh... Yeah, a lot less, but like I said, we're a platinum partner. We're supposed to have support" "I can't do anything for you unless you have more than 1,000 seats. But thank you for the bug report." "Just before we go, can I ask if the bug has been reported before? Is it likely to go into the next release?" "I can't answer that question unless you have 1,000 seats and then I can prioritise it for you."...

              You get the idea. I don't care if free software is being funded by a company. I care that I can do something about it if my software doesn't work, or if I want to make an extension, or if I want to go in a completely different direction altogether.

              If your friend does not think that they can make a business case for freeing up their code, then that's their decision. They don't owe me anything. It's their project and they can do what they want. If you are complaining that it would be nice that there were more viable business plans for free software, I'll join you on that -- but to be honest, I think most people don't look very hard before they conclude that it is impossible.

            • fbmac 2095 days ago
              If you want to work for yourself or start a startup, giving it away for free is a terribly bad move. Your friend did the right thing.
        • dahart 2096 days ago
          > A meritocracy is something I want to live in.

          Then why not celebrate BPG? It appears to stand on its own as superior to older formats. Or celebrate Fabrice? I don’t know him, but his merit appears to be earned, I think.

          Why do you think Fabrice bothers posting stuff when Google & Facebook & Microsoft exist? He could easily give up, fighting image & web standards is an impossible task for most people.

          > my friend just gave up on open sourcing their amazing project

          That’s too bad, but it’s extremely common because building an audience and solving real world problems takes a lot of work, work that’s not programming. Many amazing OSS projects fail for lack of adoption because they’re programming things that, as awesome as they may be, have no demonstrated need nor enough engagement or support to keep them going.

          > Credentialism. Reputation. Audience. These are harmful to a meritocracy.

          Credentialism I could agree with, but what’s wrong with reputation or audience? What is merit exactly, and how does it exist without reputation or audience?

          Think carefully & be honest — how many software appps or projects do you invest your own time in that have no reputation or audience? There are people, early adopters, who try unknown things a lot. Most people aren’t early adopters and don’t want to spend their time waiting for bug fixes and improvements until the software they hope will work actually works. I’d say that not only is this natural, it’s necessary in a meritocracy.

        • icebraining 2097 days ago
          Pointing out that he has merit is the whole point of meritocracy. Credentialism is about formal credentials, like academic titles.

          I'm not sure what is called the kind of tabula rasa system you're advocating, but I don't think it's meritocracy.

          • shawn 2097 days ago
            Not quite. Your past projects have become the new credentials. E.g. at most software shops, it tends to be the biggest factor in whether you get hired.

            The essence of meritocracy is that anyone can do something like this. And in this case, it's simply not true. No one would be paying attention if Ballard didn't write this, and that's at odds with the idea that you yourself could create it.

            Another way of putting it is that in a meritocracy, each project should be judged on its own merits, independent of the author. Art is separable from the artist, but unless your culture values this, you get a clique of insiders.

            • notafraudster 2096 days ago
              Who exactly is going to compensate us for the time spent giving every single proposal ever made by anyone a fair shake, given that we are no longer permitted to use heuristic shortcuts like "checking if the person has ever made something in the past" or "evaluating their formal training" or "acknowledging that they have a long term history of being a crank"?

              An author has a promising idea but asks for people to invest early in order to iterate the idea to the point where it's strictly superior to existing alternatives. Investors want to know that the idea will bare fruit, and that the author will not abandon it. How do they evaluate the author's capacity to see the project through without resorting to the author's past history of seeing projects through, references, or credentials?

              Moreover, what stops malicious actors from inundating us with garbage that takes longer to refute than to produce? We can't ban spammers because banning them is based on their past history, not what they're producing now. What if their next post isn't spam and has value?

              Surely these considerations mandate that even if you believe people are insufficiently charitable to new entrants in the market of ideas, you can't throw the babies (credentials, reputation, audience) out with the bathwater. This is a good opportunity to position yourself as having made a provocative statement that will, of course, require some concessions to reason.

        • nbsd4life 2096 days ago
          I doubt that Fabrice Bellard is getting a lot of money for his work. The money in open source goes to adding a feature in widely used projects. New projects have no users, so nobody to pay money.
    • cs702 2096 days ago
  • okket 2097 days ago
    Previous discussion from 4 years ago: https://news.ycombinator.com/item?id=8704629 (328 comments)

    Discussion about the specification from 3 years ago: https://news.ycombinator.com/item?id=10604465 (32 comments)

    • benjaminl 2096 days ago
      What has happened since those previous discussions is that HEIF is begining to get traction. Apple has adopted HEIF for it's latest OSes (iOS 11 or macOS High Sierra)[0] and Android P is adding support for it.

      HEIF is a standards based based MPEG image format that like BPG is based on HEVC. Due to HEIF being an MPEG standard and the traction it is getting in the marketplace it looks like we might finally have a true next gen format to replace JPEG.

      None of this takes away anything from BPG. I just thought is was curious that given HEIF is the obvious elephant in the room, the linked page didn't mention HEIF and indeed until now, no other comment has mentioned it.

      [0] - https://support.apple.com/en-us/HT207022

      • BurningCycles 2096 days ago
        >Due to HEIF being an MPEG standard and the traction it is getting in the marketplace it looks like we might finally have a true next gen format to replace JPEG.

        My opinion is that HEIF (using HEVC) is dead in the water as a widely used jpeg replacement, since there's pretty much zero chance of it being adopted on the internet due to it's patent/royalty situation.

        I don't see sites (nor FOSS browsers like Firefox) agreeing to pay royalties to show/support images.

        A more likely contender would be 'AVIF' based upon AV1:

        https://aomediacodec.github.io/av1-avif/

        But even this format which checks all the boxes will have a very hard time succeeding jpeg, as it is supported everywhere and simply 'good enough'.

      • zamadatix 2096 days ago
        Windows 10 added support for HEIF in 1803 as well.

        Another one to keep an eye on in the near future is AVIF which is AV1 in a HEIF container as standardized by the AOMedia. With so many big players being behind AV1 it'll be interesting to see if it can gain user traction faster than HEIF.

        • jws 2096 days ago
          …gain user traction faster than HEIF.

          In less than one year from introduction, about a half billion iOS 11 users† are using it as their default photo format. Not bad for traction.

          Of course it wasn't their decision, it just sort of happened.

          † I must confess I made up this number. >80% of iOS users are using iOS 11, last year there were 700M iPhones, there are some iPads too, and some Macs, though not all iOS hardware can do HEIF. Let's just say I'm probably within a factor two.

          • askvictor 2096 days ago
            And every time my technically-challenged colleagues want to get photos from their iPhone onto a computer or web service, they can't do it, and don't know why their iPhone's camera is broken and why they feel so stupid with all of this technology.
      • innagadadavida 2096 days ago
        Does BPG support burst mode photos? If so does it use I/P/B frames for the other frames? This is an important consideration. Another consideration is if it can store audio - essentially every photo on iPhone is a short video with audio.

        Hopefully the HEVC patent holders are reasonable and license under liberal terms - the market and opportunity is much much larger than just videos and HEIF has decent chance of killing jpeg.

  • walrus01 2097 days ago
    Sadly I don't think this will find its way into any major commercial products, because using H264/H265 and HEVC stuff in many US and Western European countries, and not paying for a patent license on a per-unit basis, is a guaranteed way to get yourself sued by some pretty big companies.

    Something AV1 based for still image might find more widespread use.

    https://en.wikipedia.org/wiki/AV1

    • bhaavan 2096 days ago
      Yes! I would have bet AVIF would have been the container format of the future. Hopefully though, it can take some learnings out of this project and become even better at the end given evolution is metadata storage expectations to support "live photos" "motion photos" etc. But having another format when there are already so many, may result in unwanted confusion too, which I would be wary of. :(
  • unicornporn 2096 days ago
    Wouldn't the AV1 Image Format be a much better option as "the next image format for the web"? Better compression than HEIC and the licencing issue seems much clearer.

    https://www.techpowerup.com/240863/google-and-mozilla-push-f...

  • xori 2096 days ago
    Results look nice, but it seems to only excel at solid colours and gradients, anything with detail is smoothed out. Which admittedly looks nicer than the classic jpg artifacts.

    http://xooyoozoo.github.io/yolo-octo-bugfixes/#abandoned-fac...

    I think the above link shows it best. Not only does the jpg get better details in the middle walls and broken windows, but it's also smaller. But the BPG gets the blue sky gradient without banding and artifacts.

    • mark-r 2095 days ago
      Thanks for the link.

      Are you sure the details you're seeing in the jpg aren't just artifacts? There's only one thing I see in the middle wall that I am confident is supposed to be there in the jpg.

      The nature of lossy compression is that you need to decide where the losses will be. I think BPG is making the right choices.

  • bufferoverflow 2097 days ago
    Looks great, but, unfortunately, it's not supported by any browser:

    https://caniuse.com/#search=bpg

    • dahart 2097 days ago
      Doesn’t popularity and somewhat widespread usage have to come before browser adoption?
      • peterwwillis 2096 days ago
        I'm pretty sure nearly every modern web technology came about because Google just wanted it, so they just implemented it. If Fabrice worked for Google we'd probably already be using it.

        You can actually see this same pattern as far back as the 60's. When the most dominant player in the tech market adopts a technology, and it's not encumbered by patents or proprietary technology or something stupid like that, it becomes a de facto standard. (It helps when they actually standardize it, but it isn't necessary)

        • dahart 2096 days ago
          It's certainly true that large players have had large influences. Which modern web technologies do you have in mind that Google wanted and forced to exist? JPEG, GIF, & PNG didn't come from Google.
    • sddfd 2097 days ago
      File a bug :)
      • masklinn 2097 days ago
        It's unlikely they'll care: browsers which don't want to deal with HEVC licensing aren't going to touch it (likely preferring AVIF), and browsers which are fine with HEVC licensing support the conceptually similar HEIC.
        • TheRealPomax 2096 days ago
          So what? That's literally the reason to file. If you don't file it, and no one else files it because "it's unlikely they'll care" then good news: you're just perpetuating a pointless self-fulfilling prophecy.

          Want them to care? File bugs. Have _everyone_ file bugs. Bug popularity and duplicate marking surfaces issues that need to be prioritised. File them for _all_ the big browsers, right now, before you take the time to respond to this comment: file them on https://developer.microsoft.com/en-us/microsoft-edge/platfor..., https://bugzilla.mozilla.org, https://bugs.chromium.org/p/chromium/issues/list, and https://bugs.webkit.org

          • jhabdas 2096 days ago
            He gets it.
            • masklinn 2096 days ago
              They get nothing whatsoever. "Getting it" would at the very least mean checking the open bug trackers for existing issues, which there are, in all three (closed WONTFIX for Firefox and never even triaged for Webkit, Chromium's activity doesn't seem to go beyond triaging — all the issue having been created circa 2014~2015).

              "Getting it" is not creating worthless busywork for maintainers by spamming their bug trackers with pointless issues — unless you're reporting to the black hole that is Apple's RADAR — it might be actually deciding to take on the issue, getting a hold of the relevant stakeholders and asking if and what it would take for this to be merged if you implemented it, and being ready to be told "no" and "nothing because it won't be".

              • TheRealPomax 2096 days ago
                No, I really do get it. Searching for a previous bug is part of filing, and you're talking about bugs that were filed three or even four years ago - so back when none of the current browsers were anything remotely like what they are today. As such, you (and others) should refile them going "these were marked wontfix 3~4 years ago but the spec and adoption has changed since then, please reconsider implementing this". I lost track of how many specs had to go through that.

                This is not "busywork for maintainers", that is how updating specs work. You WONTFIX a spec when it's too early, and then people can refile once the spec's been reworked, made usable, etc. If your project is the size of a browser, the number of issues you immediately close rivals or even eclipses the number of issues you actually work on - it's why you have weekly/daily triage sessions to go "what's now in our bin since last triage? dupe dupe wontfix dupe assign request-for-clarification wontfix, done let's get to work"

                I work for one of these companies, pretty sure I have at least a decent idea what I'm talking about. We WONTFIX specs that are too drafty, and then one or even more years later, you refile an implementation issue because the world has changed, and what was WONTFIX in the past, is now worth doing.

        • pmoriarty 2097 days ago
          Could someone expand on this?

          What are HEVC, AVIF, and HEIC licensing and why are browsers partial to some over the others?

          • ksec 2097 days ago
            HEIC is based on HEVC ( H.265 ), and therefore requires licensing and paying royalty before using it, most likely paid by Microsoft (Windows), Apple or any of your hardware manufacture. It could cost up to ( capped ) $100M per year for hardware manufacture. HEVC Advance Group has made software decoding royalty free. But you still have to paid MPEG Licensing and Velos Media. Because Apple and Microsoft likely has cross patent arrangement to most of the companies within the group, so it wouldn't matter much to them. But for everyone else, HEVC licensing is still a bag of hurt.

            AVIF is based on AV1, by Open Media Alliance lead by Google, is royalty free. ( But not patent free, please don't mixed this up ) It is new and the spec has only been released for no more then 6 weeks. Google doesn't want to pay the licensing, especially when the initial licensing terms for HEVC include cost per streaming. All of Youtube video requires VP9 ( the predecessor of AV1 ) for 2K+ resolution, and does not and likely will not ever include HEVC.

            Chrome does not support HEVC decoding even if you have hardware decoding. The same for Firefox. That is why the parent said BPG won't ever be included in browser, or Chrome and Firefox. M$ IE 11 / Edge and Safari both support HEVC.

          • Dylan16807 2097 days ago
            The most common video compression right now is h.264, which has to be licensed but isn't super onerous.

            The newer, better version is called h.265 or HEVC. BPG is a way to use HEVC's single-frame encoding to store an image. HEIC is essentially the same thing, but supported by Apple.

            HEVC has ugly licensing, causing a lot of companies to come together to make their own license-free video format called AV1. AVIF is the image format based on AV1.

            So nobody wants to go near HEVC, and if they did they would support HEIC over BPG. AVIF might get support, if they think it will be used enough to be worth it.

      • blattimwind 2097 days ago
        I guess nowadays you could even shim this (if you've got many pictures and do do it correctly, trading bandwidth against user's CPU time).
        • wongarsu 2097 days ago
          The website claims

          >Supported by most Web browsers with a small Javascript decoder (gzipped size: 56 KB).

          56kb isn't particularly small, but for an image galary it might be worth it.

          • talloaktrees 2097 days ago
            When some websites are 5mb after all ad.content is loaded. It's doesn't seem that much
            • SahAssar 2096 days ago
              It isn't the size that is the problem as much as that it is on the critical path for every image that uses it and that it does not support progressive rendering or rendering parts of the image as the file is downloaded. go to https://bellard.org/bpg/lena.html and set your browser to throttle to GPRS speeds and you will see a pretty huge difference.
        • 21 2097 days ago
          But you lose hardware acceleration. On a mobile this can matter.
          • amaranth 2096 days ago
            Maybe but I wouldn't be so sure. Mobile browsers today don't use JPEG hardware decoders and for a single frame HEVC isn't _that_ expensive to decode. I believe the argument is that hardware decoders are inconsistent (what you can decode successfully depends on what platform you're running on) and have high latency due to needing to pass the data back and forth to another chip in the system. For something like HEIF which also lets you store short videos as a replacement for animated GIFs you'd still want hardware decoding at least some of the time though.
  • ransom1538 2096 days ago
    At work we use an aws lambda job to push all uploaded images into BPG format. It's a damn nice format. Works with mobile perfectly: light weight and renders pretty quick.
  • labster 2097 days ago
    Not to be confused with BGP image format:

    https://news.ycombinator.com/item?id=14621347

  • microcolonel 2097 days ago
    It's beginning to look like AVIF is more likely to gain deployment than BPG.
  • pedalpete 2096 days ago
    Looking at the examples http://xooyoozoo.github.io/yolo-octo-bugfixes/#zoo-bird-head...

    Comparing large size to large size, the difference in resolution (to me) seems minor. The difference in filesize is 2kb, but it takes 56kb javascript to add browser support.

    Can somebody explain what I'm not understanding about the benefits here?

    • bgirard 2096 days ago
      You'd only ship the library to polyfill for legacy browsers that don't support the format and don't have more efficient native decoders. This is an alternative to having an image pipeline where you encode your images in multiple format or if you have sufficient images to make up the 56kb initial download and are willing to comprise on the initial load.

      It's also a good way to start deploying the technologies before it receives full adoption.

    • Buge 2096 days ago
      On that same (zoo bird) example, set them both to medium, and BPG looks much better to me, the crown feathers are smooth and clean, and the background is a pleasant gradient, while in JPG it is horribly blocky. Even bumping BPG down to small still seems better than JPG's medium.

      I think the hope is that soon browsers will implement BPG themselves, so no javascript will be required.

    • Fnoord 2095 days ago
      If you go to [1] you get a random picture from the list. The RNG overlords gave me Pont de Quebec at Night.

      My first focus point was the light on the right bottom side.

      My second focus point was the details of the bridge where it blends with the sky.

      My third focus point was the sun.

      My fourth focus point was the rest of the framework I missed in ref point two.

      Medium vs medium BPG is slightly bigger. We're talking about < 1 kB here. Small vs small JPG is slightly bigger. We're once again talking about < 1 kB here. Such differences are irrelevant over 2G even, so I'm cool with them.

      The quality however, on these 3 focus points, is night and day. As soon as you get JPG to small or tiny, you see block artifacts. BPG not. From this sample, I'd say that JPG medium =~ BPG small and JPG small =~ BPG tiny. So, based on that example, BPG delivers a better quality or a better compression depending on your viewpoint/interests.

      Also, browser support is just a temporary bloat issue. But yeah, we'll see which standard takes over from JPEG... there are so many, right? Plus, hardware will have to start supporting that standard as well. Look at how difficult microUSB and 3.5 mm are to replace.

      [1] https://xooyoozoo.github.io/yolo-octo-bugfixes/

      [2] https://xooyoozoo.github.io/yolo-octo-bugfixes/#pont-de-queb...

    • zokier 2096 days ago
      Compare JPEG medium against BGP small and it makes more sense. BGP looks better while being 40% smaller
    • manigandham 2096 days ago
      Try small vs small on any of the images and it's a vast difference in quality, especially with any backgrounds or gradients.
  • dahart 2096 days ago
    > images with alpha channel

    I’ve read about BPG before, but not sure I noticed alpha support. This is intriguing! I’m a bit curious: what are the use cases for a lossy image with an alpha channel? BPG doesn’t have a lossless mode, does it? Games maybe?

    And I love that it has both pre-multiplied and un-pre-multiplied storage. PNG’s un-pre-multiplied only is what prevents adoption of PNG for so many alpha related workflows.

    • adsche 2096 days ago
      > BPG doesn’t have a lossless mode, does it?

      Acording to the linked site: "Lossless compression is supported."

      • ehsankia 2096 days ago
        Most modern formats have both alpha and animation, support lossless and lossy, all while still getting better performance and compression than jpg/png. And even then, when it comes to replacing the old formats, it's still an uphill battle.
    • cooper12 2096 days ago
      > what are the use cases for a lossy image with an alpha channel?

      Basically any image that's not flat and has a shape cut out of it (you can do this with CSS nowadays, but an alpha channel is cleaner and part of the image, allowing sharing/reuse). I personally would have loved it for old oval portraits for Wikipedia where I'd be able to make the background transparent. Currently, you have to use PNG which isn't lossy and doesn't lend itself to photographs.

      • dahart 2096 days ago
        > Basically any image that's not flat and has a shape cut out of it

        My question was about lossy alpha specifically. I use alpha a lot, but I've never seen a production workflow that used lossy alpha. The alpha channel is more sensitive to compression artifacts because unlike a 3-channel sRGB image, you have no guarantees about how it gets used or what it's composited over. JPEG is designed with specific channel tolerances loosely based on the differences most humans can see in the red, green & blue channels. Since alpha applies to all channels of the background and foreground, you'd have to make extremely conservative choices with the compression. I'm not certain, but at first glance it appears to me that BPG with alpha has visible artifacts. When I look at the dice images here: https://bellard.org/bpg/gallery2.html the green one on the left has some severe banding in the edges where the one on the right is smoother.

    • adamredwoods 2096 days ago
      > what are the use cases for a lossy image with an alpha channel?

      Yes, games. Web animation. Ad banners. I usually use 8-bit PNG with quantized compression ( https://pngquant.org/ ).

  • shmerl 2097 days ago
    > Based on a subset of the HEVC open video compression standard

    Is it patent encumbered then? And can it replace JPEG in such case?

    • stefan_ 2097 days ago
      Very much so. It is very deceiving to have a lengthy discussion on licenses and not mention that using this on a public-facing website without a comprehensive patent license in place is going to get you sued.
      • shmerl 2096 days ago
        So it's nowhere a JPEG replacement then in practical terms. Something based on Daala or AV1 would make more sense.
        • MaxBarraclough 2096 days ago
          We already have FLIF.

          My understanding is that it's biggest problem is decode speed.

    • mickronome 2096 days ago
      I don't know anything about how the licencing works, and what parts are covered, but the patents reported to ITU for H.265/HEVC as a whole is substantial, see: https://www.itu.int/itu-t/recommendations/related_ps.aspx?id...
    • mda 2096 days ago
      Basically it is useless.
      • paulnechifor 2096 days ago
        Only in countries with software patents.
  • childintime 2096 days ago
    Apparently this is quite old (2012), see: https://irfanview-forum.de/showthread.php?t=10291&s=cb7ce1c4...
  • tonetheman 2097 days ago
    And while such a claim from a random would be dubious at best. Fabrice is a prolific genius. Look at this list of stuff on his main site: https://bellard.org/
    • 21 2097 days ago
      Why would it be dubious that one of the newest and most advanced video codecs has a highly efficient keyframe encoding which beats 20 years old tech?
      • ben0x539 2097 days ago
        Because of the standard "if this was so great, I'd have heard of it already" razor.
        • blattimwind 2097 days ago
          I don't think this is the first still-image application of HEVC; it's just that HEVC is a patent-licensing pit.

          Also JPEG was 1990 iirc so it's closer to 30 years old by now.

        • philjohn 2096 days ago
          Apple are using HEIF as of the latest IOS, which uses HEVC to store images and video.
  • LukeB42 2096 days ago
    Not enough comparison to PNG. Source indicates borrowing heavily from PNG though. Am I missing something here about a relation / coevolution between these formats?
  • skrowl 2096 days ago
    How does it compare to WebP & HEIF(both in performance and acceptance in modern browsers / etc), which seem very similar?
    • pornel 2096 days ago
      Half size of WebP. WebP is based on an otherwise obsolete codec that's 2-3 generations behind latest codecs.

      Similar compression to HEIF, but it's a much simpler container.

      • skrowl 2096 days ago
        Looks like Mozilla's last word on it is that they won't add it:

        https://bugzilla.mozilla.org/show_bug.cgi?id=1111277

        > Thomas Daede [:TD-Linux]

        > Comment 13 • 3 years ago

        > The licensing costs for HEVC makes implementing BPG in Firefox impractical.

        > In addition, supporting a patent encumbered image format is not in line with Mozilla's goals of promoting the free and open web.

        > BPG's technical performance is impressive, but a successor to JPEG needs to not regress on the freedom of usage that JPEG offers.

  • atern 2096 days ago
    Why? What's wrong with FLIF?
    • MaxBarraclough 2096 days ago
      Exactly what I was thinking. Surprised to see no mention of FLIF in the article. It's nothing new to do better than PNG and JPEG.

      It's HEVC-based, so it might be able to outperform FLIF for in-browser decoding speed.

  • sddfd 2097 days ago
    What's the license?
    • wolf550e 2097 days ago
      The copyright on the code is not the problem, HEVC/H.265 patents are the problem.
    • based2 2097 days ago
      "The BPG decoding library uses a modified version of FFmpeg released under the LGPL version 2.1 as HEVC decoder. The BPG decoding library excluding the FFmpeg code is released under the BSD license.

      The BPG encoder as a whole is released under the GPL version 2 license. The BPG encoder sources excluding x265 are released under the BSD license. The x265 library is released under the GPL version 2 license. "

  • jeswin 2096 days ago
    I came here hoping the discussion would be around BPG and not Bellard - not happening. HNers act like Bieber fans when it comes to Bellard. Even they have moved on.
  • guitarbill 2096 days ago
    Given that most optimisers strip metadata, and metadata can also lead to bad SecOps fails, wouldn't it be better to simply not support metadata in a new image format? Do ICC profiles on images even work properly?
    • matt4077 2096 days ago
      I believe consensus among the general population is to no longer support people using terms such as "SecOps fails".

      They did actually try to get the ICC (International Criminal Court) involved. But the judges demurred, citing an obscure software patent from 2002 and suggesting The Hague's War Crimes Tribunal as a better venue.