upvote
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.
reply
And a nominally “lossless” image may have been reencoded from a lossy source.
reply
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.
reply
Independent preprocessing doesn't make PNG itself lossy.
reply
The point is that you can’t tell whether it’s a lossless image by looking at the extension.
reply
By that definition, all formats are lossy, because any preprocessing could be lossy, and the word loses all meaning … which is why we don't use that definition.
reply
By what definition? I didn’t say anything was lossy; I said you couldn’t be sure that the image was lossless just from the extension. Of course, it might still be, and you might have other reasons to know it to be.
reply
The word doesn't lose definition, it has different definitions for codecs and images.

If you reencode a jpeg to a png, you used a lossless format but your image is very lossy.

reply
It's not the PNG encoding that causes the loss. The optimisers are literally creating a different image and then losslessly encoding it as PNG.

But it's also a valid point.

reply
Yes, but a lossless encode of a lossy copy of an image results in a lossy image functionally.
reply
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.
reply
It's a big deal :(

JPEG artifacts are literally a meme, normal people are aware of this stuff.

I hold the extremist view that had we decided to use .png for lossless webps, it would have been an overall net gain - in people's minds "png" maps roughly to "whoever last touched this image didn't do anything evil to it" - very few people care how the data is actually encoded.

reply
I mean we are already dealing with that nowadays. Many PNGs are either JPEG in a different package or straight up lossy compressed. Unfotunately extensions have never been safe for judge
reply
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)
reply
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

reply
I've been wishing for years that all of these codecs with hybrid lossless/lossy modes would just add a single l to their file extensions, purely for the annoyance of it.

Like, you can do this individually, but it's not the same thing as actually having it in the standard.

reply
Does the L stand for lossy, or lossless? Or large, as in this case?
reply
The L in JPEG XL stands for "long-term"[1]!

But people are definitely going to assume "eXtra Large". Lots of people. I guess a few will think "excel" (as in JPEG XL comes out ahead and is superior).

---

[1] https://en.wikipedia.org/wiki/JPEG_XL

reply
One L for Lossy, two for LossLess.

Does the one at the end of .JXL count toward the total? Nobody knows what it stands for anyway.

reply
See I would think lossless is the one you have to specify. (Also, it stops being "large" when you extend this gripe to similar formats like AVIF and WebP.)
reply
And no, L isn't for large, we have W for that

(You know... for "Wumbo")

reply
When writing GPU shaders it's not uncommon to use extensions like ".vert.glsl" = "vertex shader written in GLSL", ".frag.hlsl" = "fragment shader written in HLSL", etc.
reply
Multiple extensions typically denote nested filetypes.

Like files.tar.xz may be decompressed with xz and then extracted with tar to get the directory "files".

I think in your case .md.fm would be a greater fit, as the front matter is read first. Or just .fmd

reply
This is something that can be addressed by file managers - showing a metadata entry on whether it's lossy or lossless. File extension (along with the bifurcated mainstream adoption of JPEG and PNG) has been a great proxy to do this, but like others noted, can be deceptive, which is arguably worse.
reply
I can't really think of a scenario where that would be useful? File-size is more indicative of quality anyway.
reply