9 ms·
BPG Image format
- bufferoverflow 8y agoLooks great, but, unfortunately, it's not supported by any browser: https://caniuse.com/#search=bpg https://caniuse.com/#search=bpg
- sddfd 8y agoFile a bug :)
- blattimwind 8y agoI 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).
- 21 8y agoBut you lose hardware acceleration. On a mobile this can matter.
- amaranth 8y agoMaybe 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.
- wongarsu 8y agoThe 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 8y agoWhen some websites are 5mb after all ad.content is loaded. It's doesn't seem that much
- SahAssar 8y agoIt 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 https://bellard.org/bpg/lena.html and set your browser to throttle to GPRS speeds and you will see a pretty huge difference.
- masklinn 8y agoIt'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.
- pmoriarty 8y agoCould someone expand on this? What are HEVC, AVIF, and HEIC licensing and why are browsers partial to some over the others?
- Dylan16807 8y agoThe 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.
- ksec 8y agoHEIC 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.
- dahart 8y agoDoesn’t popularity and somewhat widespread usage have to come before browser adoption?
- peterwwillis 8y agoI'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 8y agoIt'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.
- deleted 8y ago[deleted]
- sddfd 8y agoWhat's the license?
- based2 8y 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. "
- wolf550e 8y agoThe copyright on the code is not the problem, HEVC/H.265 patents are the problem.
- tonetheman 8y agoAnd 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/ https://bellard.org/
- 21 8y agoWhy 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 8y agoBecause of the standard "if this was so great, I'd have heard of it already" razor.
- blattimwind 8y agoI 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 8y agoApple are using HEIF as of the latest IOS, which uses HEVC to store images and video.
- rudolfwinestock 8y agoNote that the author of the linked page is Fabrice Bellard. He created a PC emulator in JavaScript. https://bellard.org/jslinux/ https://bellard.org/jslinux/ He's also made several other impressive hacks: https://bellard.org/ https://bellard.org/
- nailer 8y agoJust reiterating this. Same guy behind FFmpeg, QEmu. One of the living legends.
- shawn 8y agoPointing 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.
- icebraining 8y agoPointing 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 8y ago
- shmerl 8y 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_ 8y agoVery 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 8y agoSo it's nowhere a JPEG replacement then in practical terms. Something based on Daala or AV1 would make more sense.
- MaxBarraclough 8y agoWe already have FLIF. My understanding is that it's biggest problem is decode speed.
- mda 8y agoBasically it is useless.
- paulnechifor 8y agoOnly in countries with software patents.
- mickronome 8y agoI 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_prod=11885 https://www.itu.int/itu-t/recommendations/related_ps.aspx?id...
- okket 8y agoPrevious discussion from 4 years ago: https://news.ycombinator.com/item?id=8704629 https://news.ycombinator.com/item?id=8704629 (328 comments) Discussion about the specification from 3 years ago: https://news.ycombinator.com/item?id=10604465 https://news.ycombinator.com/item?id=10604465 (32 comments)
- benjaminl 8y agoWhat 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 https://support.apple.com/en-us/HT207022
- zamadatix 8y agoWindows 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 8y 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.
- walrus01 8y agoSadly 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 https://en.wikipedia.org/wiki/AV1
- bhaavan 8y agoYes! 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. :(
- microcolonel 8y agoIt's beginning to look like AVIF is more likely to gain deployment than BPG.
- labster 8y agoNot to be confused with BGP image format: https://news.ycombinator.com/item?id=14621347 https://news.ycombinator.com/item?id=14621347
- dahart 8y 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 8y ago> BPG doesn’t have a lossless mode, does it? Acording to the linked site: "Lossless compression is supported."
- ehsankia 8y agoMost 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 8y 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 8y 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 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.
- guitarbill 8y agoGiven 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 8y agoI 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.
- LukeB42 8y agoNot enough comparison to PNG. Source indicates borrowing heavily from PNG though. Am I missing something here about a relation / coevolution between these formats?
- pedalpete 8y agoLooking at the examples http://xooyoozoo.github.io/yolo-octo-bugfixes/#zoo-bird-head&jpg=l&bpg=l 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 8y agoYou'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 8y agoOn 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.
- zokier 8y agoCompare JPEG medium against BGP small and it makes more sense. BGP looks better while being 40% smaller
- manigandham 8y agoTry small vs small on any of the images and it's a vast difference in quality, especially with any backgrounds or gradients.
- Fnoord 8y agoIf 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/ https://xooyoozoo.github.io/yolo-octo-bugfixes/ [2] https://xooyoozoo.github.io/yolo-octo-bugfixes/#pont-de-quebec-at-night&jpg=s&bpg=s https://xooyoozoo.github.io/yolo-octo-bugfixes/#pont-de-queb...
- ransom1538 8y agoAt 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.
- atern 8y agoWhy? What's wrong with FLIF?
- MaxBarraclough 8y agoExactly 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.
- unicornporn 8y agoWouldn'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-for-av1-image-format-adoption-beats-jpeg-and-heic https://www.techpowerup.com/240863/google-and-mozilla-push-f...
- skrowl 8y agoHow does it compare to WebP & HEIF(both in performance and acceptance in modern browsers / etc), which seem very similar?
- pornel 8y agoHalf 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 8y agoLooks like Mozilla's last word on it is that they won't add it: https://bugzilla.mozilla.org/show_bug.cgi?id=1111277 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.
- xori 8y agoResults 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-factory&jpg=s&bpg=s 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 8y agoThanks 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.
- jeswin 8y agoI 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.
- childintime 8y agoApparently this is quite old (2012), see: https://irfanview-forum.de/showthread.php?t=10291&s=cb7ce1c46108ace2b02ee89ed1211e5b https://irfanview-forum.de/showthread.php?t=10291&s=cb7ce1c4...