Live data from Hacker News

What’s the best lossless image format?

siipo.la

51–60 of 166 posts

Re: What’s the best lossless image format?

#51
post #45

Earlier quoted context omitted.

Because it's a one-time cost and you can cheaply throw more CPU power at the problem, or just wait and then you're done. If you're doing this at such a scale that encoding speed matters (like if you're Instagram) the major concern would likely be cost, which you're going to save in bandwidth every time an image is viewed.

"you can cheaply throw more CPU power at the problem, or just wait and then you're done" How am I going to "throw more CPU power at the problem" when I'm using a scanner hooked up to my laptop? Should I buy myself a new, more powerful laptop? That doesn't sound cheap. As for "just" waiting... my time is valuable, and I have better things to do with it than wait... and, unfortunately, the process of scanning and encod…

Save uncompressed to a big cheap harddrive, batch compress to PNG overnight?

Re: What’s the best lossless image format?

#52
post #38

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…

Everything about JPEG XL sounds great, except that it takes about 34 times longer to encode an image compared to PNG. Edit: Apparently there's an experimental faster version: https://github.com/libjxl/libjxl/tree/main/experimental/fast...

Depends, are you optimizing the PNG? Because cjxl is a hell of a lot faster for a much smaller file than zopflipng.

Re: What’s the best lossless image format?

#53
post #45

Earlier quoted context omitted.

Because it's a one-time cost and you can cheaply throw more CPU power at the problem, or just wait and then you're done. If you're doing this at such a scale that encoding speed matters (like if you're Instagram) the major concern would likely be cost, which you're going to save in bandwidth every time an image is viewed.

"you can cheaply throw more CPU power at the problem, or just wait and then you're done" How am I going to "throw more CPU power at the problem" when I'm using a scanner hooked up to my laptop? Should I buy myself a new, more powerful laptop? That doesn't sound cheap. As for "just" waiting... my time is valuable, and I have better things to do with it than wait... and, unfortunately, the process of scanning and encod…

Like Tomovo above already said; your workflow would benefit from using an intermediate format that is faster to encode. You can then automate the conversion to the output format to occur unattended at a more convenient time.

The use of intermediate formats is a well proven technique in video editing where encoding real time to AVC/HEVC at high quality is not possible. Codecs like ProRes are used that are much easier to encode to at the expense of storage space.

Re: What’s the best lossless image format?

#54

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…

> Opus became the definitive codec for lossy compression for the web.

never heard of Opus for images... must have been sleeping

Re: What’s the best lossless image format?

#55

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…

> Opus became the definitive codec for lossy compression for the web. never heard of Opus for images... must have been sleeping

:P I assumed anyone reading it would know Opus is an Audio-codec. Was comparing the paradigm of where I see image codecs going with a similar one that happened in audio.

Re: What’s the best lossless image format?

#56

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 fun and why not?" weekend projects.

Anyhow, I discovered that loads of stuff doesn't support WebP. This was unexpected as it's been around for ages and supported by almost everything, but things like uploading to GitHub, Telegram, and many services doesn't work. It was disappointing and I had to add PNG support just for that.

I fear that JPEG XL will be in a similar situation in the future, where loads of websites can and do use it for their images, but also loads of services don't support it so it's a lot less useful than it could/should be. I hope I'm wrong.

Re: What’s the best lossless image format?

#58

Earlier quoted context omitted.

> Opus became the definitive codec for lossy compression for the web. never heard of Opus for images... must have been sleeping

:P I assumed anyone reading it would know Opus is an Audio-codec. Was comparing the paradigm of where I see image codecs going with a similar one that happened in audio.

They are also common in that they are effectively two different codecs combined.

Re: What’s the best lossless image format?

#59
post #48

Earlier quoted context omitted.

How does it relate to JPEG2000? I may soon have to recommend a lossy but potentially lossless image format for 3D medical images (with 16 bits channels), would JPEG XL fit this bill?

The future isn't here yet unfortunately. I imagine the doctors would view these images in multitudes of ways(browsers, operating systems, image viewers) with varying level of support. So encoding in a standard that is yet to be entirely finalized and adopted is a bad move as of now. You'd be best off with going with JPEG2000 still if that's what you prefer or DICOM.

Oh adoption does not have to be that good. It is for researchers right now, to exchange results. So the only requirement is that it is possible to use it with a somewhat mature lib in python.

Re: What’s the best lossless image format?

#60

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…

> or even 20 years ago, remember JPEG2000?

Open Source JPEG2000 libraries:

- Grok, last commit 9 hours ago: https://github.com/GrokImageCompression/grok

- JasPer, last commit 5 days ago: https://github.com/jasper-software/jasper

- OpenJPEG, last commit 8 days ago: https://github.com/uclouvain/openjpeg

I didn't try them, but I think you can probably still read your 20 year old JPEG2000 files today without too much problems.

Post reply on HN