Live data from Hacker News

What’s the best lossless image format?

siipo.la

21–30 of 166 posts

Re: What’s the best lossless image format?

#21
post #18
post #10

> What is the best lossless image format? For which application? Otherwise you can only say " depends ". Tiff is good if you want to save data fast to disk in Blender. EXR is great if you want 32bit color depth, etc.

> Tiff is good Mind that TIFF is only a container format that can contain any arbitrary codec you like; it can be uncompressed pixels, RLE compressed, it can be a PNG, a JPEG XL, even lossy JPEG or WebP if you'd like. Saying your image format is TIFF is roughly as useful and conveys as much information as saying your video format is MKV.

Good point. What I wanted to say is, that what is "the best" depends a lot on the application. Maybe you don't care about compression/size, but about write speed. Maybe read speed is something you care about, maybe you do actually care about size, but compatibility with certain clients is even more important, maybe you care a lot about how long decompression takes, how much strain it puts on the CPU or the memory, etc.

So it is certainly not as simple as just going for the thing that produces the smallest file in some benchmark that may or may not fit your realworld data.

Re: What’s the best lossless image format?

#22
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 XL seamlessly.

What I'm most excited about for JPEG XL is progressive decoding, I had been following the FLIF project for a while and was disappointed with it's lack of adoption. But it's future found itself in JPEG XL.

Without a doubt 5 years now JPEG XL will become like Opus and set the standard for next generation image formats.

Re: What’s the best lossless image format?

#23
post #17

For web graphics, isn't a mix of PNG/JPEG good enough generally speaking? I'd imagine the benefits of changing to something more modern/efficient aren't worth the cost/time involved other than in esoteric situations given that most end users have high bandwidth connections and bandwidth costs typically aren't too significant?

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.

Re: What’s the best lossless image format?

#24
I wonder how fpng[1] would compare- a lossless speed optimized png compressor. Oh! The author Rich screenshoted[2] a really nice deck[3] that also boasts fpnge[4] and fjxl[5], both of which are even faster, both use AVX2 (or neon for FJXL).

Notably fjxl is in the reference libjxl tree. I'm not sure what if any constraints fast mode has, what it takes to use. The article uses cjxl, which does not run the fjxl fast mode, and further, fast mode was added after this article was written[6].

Other notes on jpeg-xl: it has progressive rendering. It has hdr!

The deck on FJXL & FPNGE is epic. Thanks Quote Ok Image (QOI) format for setting the fire on this all!!

[1] https://github.com/richgel999/fpng

[2] https://twitter.com/richgel999/status/1485976101692358656

[3] https://www.lucaversari.it/FJXL_and_FPNGE.pdf

[4] https://github.com/veluca93/fpnge

[5] https://github.com/libjxl/libjxl/tree/main/experimental/fast...

[6] https://github.com/libjxl/libjxl/pull/1124

Re: What’s the best lossless image format?

#26
post #8

I would love to see an estimation of how small real world images would get if we could calculate their Kolmogorov complexity. Aka if we could find the shortest program that produces the image as output. Some images obviously would become very small. For example an image that is all blue, a spiral, the flag of the United States, the Mandelbrot set ... But what about the average portrait for example?

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.

Re: What’s the best lossless image format?

#27

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…

I’ve read up about JPEG XL in the past but a question just occurred to me: is it just an image format or is it also a document format? Can it replace TIFF as a container for multi-page documents/images?

Re: What’s the best lossless image format?

#29

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…

Does lossless JPEG XL support 16-bit images?

Re: What’s the best lossless image format?

#30

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…

I’ve read up about JPEG XL in the past but a question just occurred to me: is it just an image format or is it also a document format? Can it replace TIFF as a container for multi-page documents/images?

No, it's not a document format. JPEG XL won't replace TIFFs by and large because it has a different use case.

TIFFs are more in-line with a combination of FLAC/WAV from the audio world. It's meant for raw data used in production/manipulation.

As a professional you would work with TIFFs/RAW photo formats and then master it in JPEG XL for mass-consumption.

Post reply on HN