News for hackers. Stuff that matters.
Re:Why JPEGs Still Rule the Web After 30 Years (2024) by tristor on Tuesday June 17, 2025 @12:09PM (#44300739)
For my extensive collection of photography, I export to JPEG-XL and then convert to JPEG for use online. Most online services, like Flickr, Instagram, et al don't support JPEG-XL, but there's almost no quality loss converting from JPEG-XL to JPEG vs exporting to JPEG directly from your digital asset management system, and storing locally in JPEG-XL works very well. Almost all desktop tools I use support JPEG-XL natively already, conversely almost nothing support WEBP.
Re:Why JPEGs Still Rule the Web After 30 Years (2024) by Zardoz84 on Tuesday June 17, 2025 @12:25PM (#44300900)
There is NO quality loss when converting from JPEG XL to JPEG and vice versa. It was done by design. Not an accident.
Re:Why JPEGs Still Rule the Web After 30 Years (2024) by adgjlsfhk1 on Tuesday June 17, 2025 @02:33PM (#44302283)
this isn't true. there's no loss from jpeg to jpeg-xl (if you use the right mode), but the reverse is not true
Re:Why JPEGs Still Rule the Web After 30 Years (2024) by Zardoz84 on Tuesday June 17, 2025 @02:47PM (#44302452)
I sorry to say that you are wrong about this.

> Key features of the JPEG XL codec are: > lossless JPEG transcoding,

> Moreover, JPEG XL includes several features that help transition from the legacy JPEG coding format. Existing JPEG files can be losslessly transcoded to JPEG XL files, significantly reducing their size (Fig. 1). These can be reconstructed to the exact same JPEG file, ensuring backward compatibility with legacy applications. Both transcoding and reconstruction are computationally efficient. Migrating to JPEG XL reduces storage costs because servers can store a single JPEG XL file to serve both JPEG and JPEG XL clients. This provides a smooth transition path from legacy JPEG platforms to the modern JPEG XL.

https://ds.jpeg.org/whitepapers/jpeg-xl-whitepaper.pdf

If you need more profs, you could transcode a JPEG to JPEG XL and convert against to JPEG. The result image would be BINARY IDENTICAL to the original image.

However, perhaps are you talking about an image on JPEG XL, using features only in JPEG XL (24 bit, HDR, etc...) that obviously couldn't be converted in a lossless way to a JPEG.

Re:Why JPEGs Still Rule the Web After 30 Years (2024) by spider-mario on Tuesday June 17, 2025 @03:32PM (#44302952)
> However, perhaps are you talking about an image on JPEG XL, using features only in JPEG XL (24 bit, HDR, etc...) that obviously couldn't be converted in a lossless way to a JPEG.

A lot of those features (non-8×8 DCTs, Gaborish and EPF filters, XYB) are enabled by default when you compress a non-JPEG image to a lossy JXL. At the moment, you really do need to compress to JPEG first and then transcode that to JXL if you want the JXL→JPEG direction to be lossless.

Re:Why JPEGs Still Rule the Web After 30 Years (2024) by CorrectHorseBat on Tuesday June 17, 2025 @03:22PM (#44302866)
Yes, JPG to JPEG XL and back is lossless, but the reverse is nowhere mentioned.

Trying around with some jpg and jxl files I cannot convert jxl losslessly to jpg files even if they are only 8bit. The jxl files transcoded from jpg files show "JPEG bitstream reconstruction data available" with jxlinfo, so I think some extra metadata is stored when going from jpg to jxl to make the lossless transcoding possible. I can imagine not supporting the reverse (which is pretty useless anyway) allowed for more optimizations.

Re:Why JPEGs Still Rule the Web After 30 Years (2024) by jbverschoor on Wednesday June 18, 2025 @12:09PM (#44311094)
JPG to JXL is lossless, and will save around 20%

JXL to JPG is lossless as in a bit-for-bit identical file can be generated

Re:Why JPEGs Still Rule the Web After 30 Years (2024) by adgjlsfhk1 on Wednesday June 18, 2025 @02:18PM (#44312114)
> JXL to JPG is lossless

only if you got the JXL from JPG.

Re:Why JPEGs Still Rule the Web After 30 Years (2024) by gabrielhidasy on Tuesday June 17, 2025 @03:19PM (#44302827)
> However, perhaps are you talking about an image on JPEG XL, using features only in JPEG XL (24 bit, HDR, etc...) that obviously couldn't be converted in a lossless way to a JPEG.

So he was not wrong about this. You have perfect JPEG -> JPEG XL conversion, but not the other way around.

Re:Why JPEGs Still Rule the Web After 30 Years (2024) by adgjlsfhk1 on Tuesday June 17, 2025 @05:00PM (#44303900)
default jpeg-xl uses a different color space (XYZ), bigger transform (up to 256x256), rectangular transforms, etc. if you go from jpg to jxl, you can go back (but your jxl file will be less efficient), but if you compress directly to jxl, you can't losslessly go to jpg
Re:Why JPEGs Still Rule the Web After 30 Years (2024) by tristor on Tuesday June 17, 2025 @01:30PM (#44301564)
That's good to know. I'm not an image format expert, but I couldn't see any loss that was visually discernible at any rate.
Re:Why JPEGs Still Rule the Web After 30 Years (2024) by eviks on Wednesday June 18, 2025 @02:11AM (#44307071)
You're confusing jpg>jxl>jpg, which can be done losslessly via a special mode, and jxl > jpg, which can't (even ignoring all the extra features of jxl that jpg doesn't support)