Live data from Hacker News

Image Compression

makingsoftware.com

11–20 of 37 posts

Re: Image Compression

#11

> Now that WebP is widely supported by browsers and operating systems, there's really no downside to using it. It's much more flexible than JPEG or PNG and offers better compression than both of them. I'd probably skip WebP, and go straight to AVIF at this point. I believe all modern browsers support it, and it compresses better than WebP.

TIL that AVIF has been supported across all browsers since January 2024. Definitely looks like something I can start using.

Re: Image Compression

#12
post #5

Worth highlighting the QOI Image format (qoiformat.org) showing that you can also get significant image compression benefits with a simple 1-page specification [1]: > QOI is fast. It losslessly compresses images to a similar size of PNG, while offering 20x-50x faster encoding and 3x-4x faster decoding. > QOI is simple. The reference en-/decoder fits in about 300 lines of C. The file format specification is a single p…

The opposite should also be possible with the ultimate formula a giant lookup table with all the images preloaded.

Could ofc also make decompression by trying a million things.

To exist the compressed file only needs a formula to validate the result. Like it being a type 42 image with this checksum. It might take a quantum computer to confirm existence.

I had a fun idea to skip pixels and rows and make a tiny image at the beginning of the file followed by almost identical images with different offset.

Like progressive jpeg the entire image is visible almost instantly.

They could for practical purposes be seperate files too.

For mobile devices you only need the first n images for higher resolution and/or larger displays you keep loading until the resolution is acceptable or the tiles run out.

It would be wonderful for thumbnails. Display say 32x32, pre-load 256x256 and continue loading when clicked.

Re: Image Compression

#13
post #7

Don't sleep on JPEG XL. It's used under the hood within DNG files (at least, it's an option, Adobe DNG Converter can leverage it, including by the CLI), DxO PureRAW leverages it in the latest versions. Apple Photos can view them, and I think it's been the compression methodology used inside their ProRAW DNGs for a while (which probably by default makes it one of the worlds most popular image compressors for RAW files…

JPEG XL aka .jxl is now supported by Firefox 152 and Chrome since 145 (behind a flag though on both).

JXL is the best image format we have - supports lossy and lossless compression, HDR, and much more!

https://jpegxl.info/

Re: Image Compression

#15
post #12
post #5

Worth highlighting the QOI Image format (qoiformat.org) showing that you can also get significant image compression benefits with a simple 1-page specification [1]: > QOI is fast. It losslessly compresses images to a similar size of PNG, while offering 20x-50x faster encoding and 3x-4x faster decoding. > QOI is simple. The reference en-/decoder fits in about 300 lines of C. The file format specification is a single p…

The opposite should also be possible with the ultimate formula a giant lookup table with all the images preloaded. Could ofc also make decompression by trying a million things. To exist the compressed file only needs a formula to validate the result. Like it being a type 42 image with this checksum. It might take a quantum computer to confirm existence. I had a fun idea to skip pixels and rows and make a tiny image a…

blur hash is an algorithm for a low res representation of an image for placeholder purposes, it's pretty nice. https://blurha.sh

Re: Image Compression

#16
post #7

Don't sleep on JPEG XL. It's used under the hood within DNG files (at least, it's an option, Adobe DNG Converter can leverage it, including by the CLI), DxO PureRAW leverages it in the latest versions. Apple Photos can view them, and I think it's been the compression methodology used inside their ProRAW DNGs for a while (which probably by default makes it one of the worlds most popular image compressors for RAW files…

Disclaimer : I worked at DxO.

DNG is more a container in which you can store lots of different think and not only RAW images.

For example PureRaw output Linear DNG that is not a RAW anymore. In the same way ProRaw is not a RAW image dispite it's name. But yes PureRaw and some ProRaw are compressed internally with jxl.

Re: Image Compression

#17
post #7

Don't sleep on JPEG XL. It's used under the hood within DNG files (at least, it's an option, Adobe DNG Converter can leverage it, including by the CLI), DxO PureRAW leverages it in the latest versions. Apple Photos can view them, and I think it's been the compression methodology used inside their ProRAW DNGs for a while (which probably by default makes it one of the worlds most popular image compressors for RAW files…

Those are good venues to sneak JPEG XL into the mainstream. It would be a pity if it became another JPEG 2000. On the other hand, JPEG 2000 was probably just too advanced and computationally complex to be widely adopted at the time. Sometimes I look back at it and, after all the extensions and revisions, it feels like it has everything—but it’s still a niche codec. A cautionary tale, and a pattern that tends to repeat itself with codecs...

Re: Image Compression

#18

> Now that WebP is widely supported by browsers and operating systems, there's really no downside to using it. It's much more flexible than JPEG or PNG and offers better compression than both of them. I'd probably skip WebP, and go straight to AVIF at this point. I believe all modern browsers support it, and it compresses better than WebP.

> I'd probably skip WebP, and go straight to AVIF now. That is my assessment as well. The compression ratios with AVIF are ridiculous compared to older formats.

It's great but you definitely pay for it. Encoding can be really slow, and to a lesser extent decoding as well.

So I still end up using .jpg quite often, or .webp as a good middle ground

Re: Image Compression

#19

Earlier quoted context omitted.

> I'd probably skip WebP, and go straight to AVIF now. That is my assessment as well. The compression ratios with AVIF are ridiculous compared to older formats.

It's great but you definitely pay for it. Encoding can be really slow, and to a lesser extent decoding as well. So I still end up using .jpg quite often, or .webp as a good middle ground

[dead]

Re: Image Compression

#20
post #5

Worth highlighting the QOI Image format (qoiformat.org) showing that you can also get significant image compression benefits with a simple 1-page specification [1]: > QOI is fast. It losslessly compresses images to a similar size of PNG, while offering 20x-50x faster encoding and 3x-4x faster decoding. > QOI is simple. The reference en-/decoder fits in about 300 lines of C. The file format specification is a single p…

I've had a lot of success just LZ4ing a bitmap.
Post reply on HN