Live data from Hacker News

What’s the best lossless image format?

siipo.la

91–100 of 166 posts

Re: What’s the best lossless image format?

#91

Earlier quoted context omitted.

If it takes that much longer to encode then I am guessing it takes a lot longer to decode as well which I am going to guess makes it completely out for image sequences, film archiving, VFX work, high end photography, etc etc.

It may take less time actually since it can be parallelized. PNG's big problem is it's serial.

In fact, Apple introduced its own extension chunk to PNG to enable parallel decoding, by splitting IDAT into two halves, put a zlib sync flush between them and record the offset to the second half [1]. This kind of split is bulit into JPEG XL.

[1] https://www.hackerfactor.com/blog/index.php?/archives/895-Co...

Re: What’s the best lossless image format?

#92

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…

> Itanium was better than AMD64,

No, AMD64 is far superior, Itanium's benefits never materialized. Any BOTH offer backwards compatibility, anyhow.

> DVORAK is better than QWERTY,

Not by enough to matter except in extreme circumstances. I say this as a Dvorak typist.

> I'm sure Esperanto is lightyears ahead of the monstrosity that is English.

It's not. It is needlessly complicated. "Basic," "Simple," or "Technical" English (which came along a few years after Esperanto) is far simpler and quicker to learn.

> But backwards compatibility always wins, because it fits what the world was already designed around.

Besides all the above being incorrect, some examples like the rise of ARM serves as a count-point.

Re: What’s the best lossless image format?

#93

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…

The standard supported by a whopping 9 (!) apps! Sorry, but prevalence of support matters too, and PNG can't be beat there.

Re: What’s the best lossless image format?

#94
post #36

The best lossless format is the one you can decode back to the original image. When evaluating them, there is an implicit assumption that the decode step will happen a short time later, but that's not always true. Will there be JPEG XL decoders commonly available in 40 years? Will the code even compile then? As a thought experiment, try to find the lossless encodings from 40 years ago and see if they can be faithfull…

This seems excessively handwringing about code rot. TIFF was introduced 35 years ago and still well supported. JPEG2000 didn't become super widespread, but is still used in many places. Smart passports encode your passport photo in JPEG2000 for example.

Another example is in radiology. Many thousands of medical images are created and stored in lossless JPEG2000 every day with entire ecosystems of software to store and move them.

Re: What’s the best lossless image format?

#95
post #26

Earlier quoted context omitted.

You cannot calculate Kolmogorov complexity in all cases because that would involve solving the halting problem. It is worth pointing out that certain formats like AVIF do sort of do this: they use a few different algorithms, see which combination of algo/block split removes the most entropy, and then compress _that_. In practice, this is pretty good for most non-noisy images.

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

If you're doing some kind of "pre-compression" stage then you want to reduce entropy as much as possible so as to make the "real" compression more effective.

Re: What’s the best lossless image format?

#96

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…

> 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…

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 the road, where jpg and png will likely work for decades.

Re: What’s the best lossless image format?

#97

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…

> Itanium was better than AMD64, No, AMD64 is far superior, Itanium's benefits never materialized. Any BOTH offer backwards compatibility, anyhow. > DVORAK is better than QWERTY, Not by enough to matter except in extreme circumstances. I say this as a Dvorak typist. > I'm sure Esperanto is lightyears ahead of the monstrosity that is English. It's not. It is needlessly complicated. "Basic," "Simple," or "Technical" En…

ARM enabled a class of devices that x86 outright didn't support at the time (and largely still does not). In my eyes, that's the exception to the rule: when something is not merely incrementally better, but actually a difference in kind. That's what it takes to supersede backwards compatibility.

I said in my last post that I expect h.264 to become the MP3 of video files—but if that doesn't happen, I suspect it will be due to the format's lack of HDR support. That's also a difference in kind—something every consumer will immediately notice, if high quality HDR displays become common in the future.

Re: What’s the best lossless image format?

#98
I guess this would be a good time to plug a small project I worked on: https://github.com/rben01/collagen . I got tired of seeing how crappy text looked when placed on a JPEG (due to the compression artifacts) and how large some PNGs were because they had a small JPEG-like area, so I made a little CLI program that solves that problem. Rather than settle on any particular image format, it allows the user to provide a collection of inputs -- images (in any format your browser supports), SVGs, shapes, text -- and bundles them into a single SVG file (it base64 encodes the images). So if you want to scale a PNG and place it on top of a JPG, you... just do that, with SVG transforms and whatnot. It produces a single file and is a lot easier than writing out the SVG yourself, and is nearly as easy as opening up a tailor-made mage editor and doing it there. And it's really, truly lossless, as it doesn't touch any of the input data.

In theory, you wouldn't even transmit the SVG directly; you'd zip up the components and send them across the network and then encode them into an SVG on the other end, which would mitigate some of the size increase due to base64 encoding.

Re: What’s the best lossless image format?

#99
post #94
post #36

Earlier quoted context omitted.

This seems excessively handwringing about code rot. TIFF was introduced 35 years ago and still well supported. JPEG2000 didn't become super widespread, but is still used in many places. Smart passports encode your passport photo in JPEG2000 for example.

Another example is in radiology. Many thousands of medical images are created and stored in lossless JPEG2000 every day with entire ecosystems of software to store and move them.

Also in digital cinemas films are JPEG2000 sequences.

Re: What’s the best lossless image format?

#100

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…

The standard supported by a whopping 9 (!) apps! Sorry, but prevalence of support matters too, and PNG can't be beat there.

This is very misleading.

Some of those 9 "apps" include imagemagick, ffmpeg, exiftool, libvips, and Qt KImageFormats.

These libraries power a vast amount of software. Support is also in beta for Firefox and Chrome.

Post reply on HN