logoalt Hacker News

tepmoc • today at 12:20 PM • 6 replies • view on HN

One downside is that you cannot tell if format lossy or lossless by looking at its extension.


Replies

eviks • today at 3:03 PM

You cannot tell it just from the extension either. If you like extensions, you can use a '.lossless.jxl'. And in general for most formats, you can use metadata to store that info (also doesn't guarantee anything)

debazel • today at 1:20 PM

You can’t really do that with PNG today either, because of all the PNG optimizers that quantize images before encoding them to PNG for better compression.

➕ show 1 reply
AshleysBrain • today at 12:39 PM

That's true of WebP and AVIF as well. I think all modern image codecs have both lossy and lossless modes - the separation between JPEG for lossy and PNG for lossless seems to be a historical oddity.

➕ show 1 reply
adzm • today at 12:42 PM

This is indeed frustrating, though realistically not that big of a deal for most users, especially if you consider lossless as just highest quality. Though personally I think it makes sense to have different extensions by convention for lossless and animated images.

➕ show 1 reply
pmarreck • today at 12:23 PM

ah, that's a good point.

perhaps use .ll.jxl to indicate "lossless jpegxl" informally?

prior art: I've been using .frontmatter.md or .fm.md for markdown files with frontmatter

➕ show 2 replies
Levitating • today at 2:14 PM

I can't really think of a scenario where that would be useful? File-size is more indicative of quality anyway.