Live data from Hacker News

BPG Image format

bellard.org

301–310 of 339 posts

Re: BPG Image format

#301

Earlier quoted context omitted.

Isn't there hardware support for JPEG decoding on most mobile devices? If so, I imagine it couldn't compete performance and battery life wise. I remember Mozilla did a software video decoder once in JavaScript. Still, it is quite amazing.

this will definitely need to be hardware-supported for decoding. on my phone, the decode time far exceeds the time it would take to serve up a bigger jpg file. the demos reminded me what browsing on dialup was like. in fact dialup was better cause at least the decoding/loading was progressive/incremental, which doesnt seem to be the case here. i assume it's just the way the decoder is implemented?

I decided to give it a try on a low-spec Android tablet, running latest version of Firefox. Got coloured horizontal stripes instead of a proper picture for every BPG example – and not just once; I was unable to view the images on the tablet.

Not quite production-ready, I think.

Re: BPG Image format

#302
post #148

The big story here is this introduces a new image file format without requiring you to upgrade a browser or download a plugin . Those aren't PNGs of representative images you're looking at - that's BPG decoding happening in your browser. So we don't like HVEC due to patent worries? Fine, we can swap in another format and use the same technique. We don't have an I-frame format for Daala that's finalized yet? Fine, we…

Are you referring to this?

Google Animated doodle with JPEG and opacity

http://zoompf.com/blog/2012/04/how-do-google-animated-doodle...

Re: BPG Image format

#303
post #295
post #258

Earlier quoted context omitted.

I used to own the jpeg decoder at Mozilla, and this was certainly the case last time I looked at it. Even without SIMD, JPEG decoding is pretty cheap compared to most of the things the browser does. I certainly wasn't clamoring for someone to burn JPEG into silicon; I had other things keeping me up at night.

Strange: JPG is, when compressed, order of times smaller than uncompressed, so if the graphic card would accept the compressed image, the amount of used memory bandwidth can significantly decrease. I also believe that the graphic card can achieve more parallelisation and therefore handle much bigger JPG images, which we produce all the time with always bigger cameras. I believe that some browsers actually keep in RAM…

Hardware is real-estate in ever compacting mobile landscape.

Re: BPG Image format

#304

Earlier quoted context omitted.

If you're curious how it works, untar http://bellard.org/bpg/libbpg-0.9.tar.gz and have a look at the post.js file.

I'm a designer, can't read code, and I'm trying to see if I should evangelize this at work. Its better if you could communicate with us non-technical folk and post an answer that the previous guy asked so that we other designers can also understand.

it waits till the page is loaded (window.onload)

grabs all image urls of a page

checks which have .bpg extensions

replaces all these .bpg img tags with canvas tags

loads all the images with Ajax and renders them into the canvas tags

Re: BPG Image format

#305

After making a few needed tweaks to get libbpg to compile on Mac OS X, I used the compiled bpgenc binary to convert a test PNG to BPG format. I also converted the PNG to a JPEG for comparison purposes. You can see the results here: http://justinmayer.com/bpg-test/ Size of PNG before conversion: 186K Size after conversion to JPEG: 52K Size after conversion to BPG: 9K I took the liberty of submitting a Homebrew formula…

I think your page has a bug - the "original png" seems to be encoded in jpg! (The usual jpg artifacts are very visible around the edges.) Thanks for posting the extra example, the bgp looks very good indeed.

I believe that's because PageSpeed is automatically converting the PNG to JPEG on-the-fly before serving the image to the browser, ostensibly for speed reasons. How ironic. ;^)

Re: BPG Image format

#306
post #295
post #258

Earlier quoted context omitted.

I used to own the jpeg decoder at Mozilla, and this was certainly the case last time I looked at it. Even without SIMD, JPEG decoding is pretty cheap compared to most of the things the browser does. I certainly wasn't clamoring for someone to burn JPEG into silicon; I had other things keeping me up at night.

Strange: JPG is, when compressed, order of times smaller than uncompressed, so if the graphic card would accept the compressed image, the amount of used memory bandwidth can significantly decrease. I also believe that the graphic card can achieve more parallelisation and therefore handle much bigger JPG images, which we produce all the time with always bigger cameras. I believe that some browsers actually keep in RAM…

> I also believe that the graphic card can achieve more parallelisation and therefore handle much bigger JPG images

Very large images are fairly rare on the web. In particular phones don't have giant displays, so it's usually a waste of bandwidth to send a huge picture to a phone as part of a webpage. And, speaking only for mobile Firefox at the time I worked on it, we had lots of bigger problems with large images than decoding speed. For example, Firefox would keep the whole decoded image in memory while it was onscreen, even if it was only displaying only part of the image or only a downsampled version of the image. If it's a giant image, the decoded image could use up a large fraction of the device's memory.

I'm also not aware of any major phones with have GPGPUs -- I'm not an expert in this stuff, but I think you'd need that to get any serious acceleration from JPEG decoding.

Re: BPG Image format

#307
post #301

Earlier quoted context omitted.

this will definitely need to be hardware-supported for decoding. on my phone, the decode time far exceeds the time it would take to serve up a bigger jpg file. the demos reminded me what browsing on dialup was like. in fact dialup was better cause at least the decoding/loading was progressive/incremental, which doesnt seem to be the case here. i assume it's just the way the decoder is implemented?

I decided to give it a try on a low-spec Android tablet, running latest version of Firefox. Got coloured horizontal stripes instead of a proper picture for every BPG example – and not just once; I was unable to view the images on the tablet. Not quite production-ready, I think.

Similar issue with Firefox/Android, the Lena BPG images are completely scrambled to hell.

Safari/iOS and Chrome/Android worked with no issue. Desktop Firefox also worked.

Re: BPG Image format

#308

Very out of topic but, is lena.jpg still acceptable? I mean, tech industry is getting better at inclusion but come on, are we still using that crop from Playboy?

Just one thought: If some woman (or man, or whatever, really) used a similar crop from playgirl in a paper ...

Yeah, sure, from a historical perspective, the situation is not exactly symmetrical, and if it helps with normalizing the situation, maybe Lenna should be banished ... but then again, I would think that if the atmosphere is right otherwise, I doubt anyone would really be bothered by the use of mildly erotic pictures where there is consent from the person in the picture?

Re: BPG Image format

#309
post #15
post #10

Earlier quoted context omitted.

"Most devices already include or will include hardware HEVC support, so we suggest to use it if patents are an issue." I don't know if that suggestion makes much sense, but you missed it in your quote.

What kinds of devices have hardware HEVC acceleration? Phones, PC graphics cards, Blu-ray players?

nVidia GPUs with GM2xx chips (currently GeForce 900 Series)

Re: BPG Image format

#310

Earlier quoted context omitted.

If you're curious how it works, untar http://bellard.org/bpg/libbpg-0.9.tar.gz and have a look at the post.js file.

I'm a designer, can't read code, and I'm trying to see if I should evangelize this at work. Its better if you could communicate with us non-technical folk and post an answer that the previous guy asked so that we other designers can also understand.

If you're a designer, and don't understand the issues involved, you probably should refrain from evangelizing sub-1.0 versioned products.
Post reply on HN