Live data from Hacker News

What’s the best lossless image format?

siipo.la

141–150 of 166 posts

Re: What’s the best lossless image format?

#141
post #87

Earlier quoted context omitted.

Wouldn’t you want entropy to increase when you compress?

Entropy can be considered on a per-byte or per message basis, and it seems that people who are talking about data at rest (compressed pictures, archives, etc) almost always talk about the per-message numbers. I don't think I've ever seen Kolmogorov complexity applied to a bitstream. It's always been per message. In which case entropy is exactly conserved, unless the encoding is lossy.

The term is a mess in computer science. The standalone definition almost works reverse to the definition in thermodynamics. There is also entropy coding, which is a compression through a set of prefixes and entropy compression which is about the termination of processes. I am sure there are many more...

Most practical approach is to read the meaning through the respective context and sometimes to ignore the sign...

That said, I believe the parent is correct. Compressed data certainly has a higher entropy. But any additional bit from an image or sound is rarely independent in the first place like Shannon demanded it to be the case for the definition of entropy. That they are not independent is precisely the attack vector of many forms of compression. For example the base frequency of a JPG has more entropy if we use the literal definition than higher frequencies that get removed because they lack entropy in a information technical sense.

Re: What’s the best lossless image format?

#142
post #61

Earlier quoted context omitted.

Quite, and encoding speed, which is included, seems almost irrelevant

Encoding speed can be very important, especially if you are seeking to decode the resulting image as quickly as possible at all times. Certain image formats are wildly better real-time containers than others. Encoding speed is irrelevant unless it's very low or very high. Most people are thinking amortize the decode against the encode and don't even consider what would happen if you took it into the other extreme. Di…

Additionally it should be mentioned how crazy imaging tech got lately. USB2 with 480 mbit/s is at the physical limit near the speed of light. This is why it easily fails in reality if you have the slightest disturbance. Faster busses like USB3 basically use more lines even if we still call it serial...

If you would transfer raw image data (rgba) you get what for full hd images? Around 7 fps? I don't even want to see the bus for modern smartphone cameras that now seem to casually have around 100 megapixels...

So very fast "on-site" encoding is pretty much mandatory today...

Re: What’s the best lossless image format?

#143

JPEG XL is the standard to beat them all. Like how Opus became the definitive codec for lossy compression for the web. JPEG XL covers nearly every use case for images, even replacing GIFs with it's animation support. Existing JPEGs can also be re-encoded losslessly into JPEG XL format/data structure and get significant file size savings. This backwards compatiability is very important in transitioning to web to JPEG…

If the format is meant to be the next defacto standard, wish they made the name more distinguishable. People without fully understanding it will abbreviate to JPEG as well and definitely cause confusion.

Re: What’s the best lossless image format?

#144

Earlier quoted context omitted.

Apple didn't support WebP for the longest time. A bunch of fairly major sites started using them. While they worked in the browser, when downloading the image macOS couldn't open it. The same went for the video format. I just tried downloading a couple and they seem to work now, but I've grown to hate WebP. Even if they open today, I likely won't keep anything saved as WebP, because I won't trust it will work down th…

Apple could force the industry forward if they added Opus, FLAC, and JPEG XL support everywhere. Ok, they’re often the ones holding everyone else back in these areas.

It's not too wrong to say Safari is the new IE being the anomaly of all.

Re: What’s the best lossless image format?

#145

(2021) I wonder how AVIF and JPEG XL would stack up today.

Lossless was not a focus point for AVIF. There JPEG XL wins hands down, with something like 50 % difference. Also, AVIF can only do up to 12 bit lossless, whereas photography workflows benefit from 14+ bits.

On lossy JPEG XL wins by 17%: https://twitter.com/jonsneyers/status/1532771586381688833

"Overall for lossy, for the same visual quality, JPEG XL is ~17% smaller than AVIF, which is ~17% smaller than WebP, which is ~17% smaller than JPEG."

Re: What’s the best lossless image format?

#146

Earlier quoted context omitted.

> Without a doubt 5 years now JPEG XL will become like Opus and set the standard for next generation image formats. I wrote a little X11 screenshot tool last year; one of the reasons I wrote it is because I wanted to save images as WebP rather than PNG that most tools use, since it's quite a bit smaller. Not that I'm running out of disk space, but it just seemed nice; one of those "no, it's not really needed but it's…

You could make a similar case for audio. GP described Opus as "the definitive codec for lossy compression", which made me do a bit of a double take. Opus is absolutely the technically superior audio format, but when you want to give users a file you'll be sure they can play, you give them an MP3. I expect JPEG and PNG to become for images what MP3 is today. And I expect H.264 to become that for video. These formats a…

>but when you want to give users a file you'll be sure they can play, you give them an MP3.

Or AAC-LC. Which is so much better than MP3 while having the 99.9999% compatibility. ( It is pretty hard to find something that support MP3 and NOT AAC )

Re: What’s the best lossless image format?

#147

Earlier quoted context omitted.

You could make a similar case for audio. GP described Opus as "the definitive codec for lossy compression", which made me do a bit of a double take. Opus is absolutely the technically superior audio format, but when you want to give users a file you'll be sure they can play, you give them an MP3. I expect JPEG and PNG to become for images what MP3 is today. And I expect H.264 to become that for video. These formats a…

I don't think you're right about H264 for video. Video is big enough that there is real money to be made in better formats.

In 2020, 90%+ of online Video are still served with H264. And then you have to factor in storage cost. Remember Network bandwidth cost continues to drop with clear roadmap ahead. While Storage, both NAND and HDD cost reduction has many roadblocks. Storing additional video in different codec can be costly depending volume.

Re: What’s the best lossless image format?

#148

Earlier quoted context omitted.

Why is encoding speed irrelevant? I'm currently in the process of scanning and archiving lots of photographs as high-resolution 16-bit PNG's and encoding speed is definitely a significant influence on how long this process takes.

Can I ask why you chose PNG for your archive format?

It's lossless, offers compression, works with 16-bit images, and is well supported in a lot of software on all sorts of platforms.

Re: What’s the best lossless image format?

#149
post #32

JPEG XL is the standard to beat them all. Like how Opus became the definitive codec for lossy compression for the web. JPEG XL covers nearly every use case for images, even replacing GIFs with it's animation support. Existing JPEGs can also be re-encoded losslessly into JPEG XL format/data structure and get significant file size savings. This backwards compatiability is very important in transitioning to web to JPEG…

Also ticks the HDR box! As I comment elsewhere[1] it also has an experimental fast mode in tree that is crazy fast, using AVX2, NEON, or fallback. Hopefully Microsoft patenting the thing someone else invented (ANS)[2] doesn't gum this all up. [1] https://news.ycombinator.com/item?id=31658871 [2] https://news.ycombinator.com/item?id=31657383

JPEG XL in lossy mode models SDR and HDR images using the same model (absolute color XYB). This reduces tweaking and makes it easier technically to create mixed SDR/HDR composites, animations or overlays. All other coding systems that I know of use a different coding method for SDR and HDR, meaning that the quality settings and other encoding parameters are slightly different for these modes.

Re: What’s the best lossless image format?

#150
post #23

Earlier quoted context omitted.

webp, webp2, and avif are absolutely worth using in modern web scenarios. It's even considered "poor practice" to serve legacy formats now.

I wouldn't say it's "poor practice" to serve legacy formats. If you're using a setup to allow for fallbacks, that's the best practice. There are more device types some developers need to consider than the latest version of Chrome.

That's why I put it in the quotes. Google will flag you for core web vitals issues if you're serving jpegs and pngs all over the place.

Many CDNs automatically serve the best format compatible with the useragent these days!

Also... the bit about the latest version of Chrome is pretty far off. WebP has been usable for 90+% (for my use cases, 99%) of the web for a LONG time. The only thing holding us back was safari 14.0 which is now not on my list of targets!

Post reply on HN