Lossless jpeg xl images not rendering correctly in Preview on macOS 15.7

I have created a number of jpeg xl saved images to reduce storage space. These clearly are lossless by looking at them at extreme zoom levels in a range of applications. These images were not photographs but test patterns. While I have the originals I have not lost any content I do find it frustrating that the preview application in 15.7 and earlier cannot render lossless jpeg xl correctly. Clearly the chroma bandwidth has not been recreated. The result is that colours leak out in to each other and white areas. Why is this. Safari for example seems, as far as can tell, to have no such problem rendering lossless jpeg xl. Generally preview is excellent for that very purpose as a preview to judge quality, in this case it is not.


[Re-Titled by Moderator]

Original Title: jpeg xl lossless

Mac Pro, macOS 15.7

Posted on Sep 24, 2025 12:09 PM

Reply
52 replies

Sep 25, 2025 9:56 AM in response to tangyminty

Forget chroma bandwidth. That is a subsampling routine used for video, only. Nothing to do with still images at all.


It's a bit difficult to figure out what you mean by "color leaking out". Other than this image you posted.



But dialabrain already covered what's going on with the two top images. The old version of Graphic Converter is simply doing a really bad job displaying the .jxl image. That is, the light and dark edges you're seeing in GC aren't in the .jxl image at all.


I was curious to see why the page dialabrain linked to had such a small .jxl image compared to the other formats. I grabbed their .jxl and .png images, then displayed them in Photoshop with one layered on top of the other. Turning the top on and off while zoomed way in, the .jxl image had a lot of pixels what were different from the .png version. Since PNG is always a lossless format, that means the .jxl image on that page was not saved as lossless.


To test that further, I save the PNG image as various lossless .jxl images (Fastest, Medium, Slowest) and they all came out to about 1.6 MB in size. A bit better than the PNG's size of 2.2 MB. And since they were saved as lossless, doing the same layered viewing in Photoshop, not one pixel was different from the other format. The same result etresoft showed. As would be entirely expected when both file formats are lossless.



I also took this image (a PNG) and saved it as a lossless .jxl image. Then opened both of them in the latest version of Graphic Converter. They displayed identically. Same as in Preview or Photoshop.


Basically, ignore the color rendering you're seeing for .jxl images in Graphic Converter 11.x. It's not accurate.

Sep 26, 2025 5:05 PM in response to dialabrain

dialabrain wrote:

Yes. As I noted previously.

For any such problem, the experiences of one person with one file do not necessarily apply to any other file. A good way around that is to provide a URL to a file so that other people can try it too. Nobody in this thread (myself included) did that. Instead, we're all looking at screen shots of random apps displaying random files. Those mean nothing.


I downloaded an old Apple logo from here: https://commons.wikimedia.org/wiki/File:Apple_Computer_Logo_rainbow.svg. It's an SVG, but it has a PNG preview. That's what I used. I converted it to JPEG XL using the command line tool and it worked fine in both Pixelmator Pro and Preview.


Then, in Pixelmator Pro, I added a new background layer to the original PNG, filled it with white, re-saved it, and tried that. This time I did get artifacts in Preview, but not in Pixelmator Pro. I tried again with a blue background with similar results.



Sep 26, 2025 2:42 PM in response to Kurt Lang

Kurt Lang wrote:

What app were you using? I can't get Photoshop to ruin the edges like that. Solid background or otherwise.

I was using the open source command line tool: https://github.com/libjxl/libjxl


I was only using this tool to create lossless jpeg xl files. Then I would open them in Preview and Pixelmator Pro for comparison. Pixelmator Pro displays them correctly. Preview must be doing some kind of intermediary lossy JPEG conversion if there's no alpha channel.


I ran into something similar when I was trying to figure out why I couldn't get lossless HEIC to work properly. I got a WWDC session with Apple and they explained it. It's designed for the iPhone sensors and it's inherently lossy. It's just that the iPhone sensor will always generate photographic images so no one is able to see the difference. Apple doesn't like rasters with sharp edges like that. It should be an SVG. And if it's not, we'll make sure you regret not doing so.

Sep 27, 2025 12:56 AM in response to dialabrain

To me it seems clear preview is to blame. Dropping the jpeg xl in to safari seems fine so apple have a codec framework that can handle jpeg xl lossless. The issue is preview. The irony is that part of my collection of images converted to lossless jpeg xl is from png serve the specific purpose of testing monitors and thunderbolt/displayport and hdmi bandwidth. A lot of hubs with displayport/hdmi claim 4k60 and so on but do so by cutting the chroma bandwidth with clearly visible fuzziness where primary colours are side by side. OK of course I can and will use png but it is disappointing that Apple can have preview load lossless images that are downgraded when saved to another lossless format.

Sep 27, 2025 6:05 AM in response to tangyminty

tangyminty wrote:

part of my collection of images converted to lossless jpeg xl is from png serve the specific purpose of testing monitors and thunderbolt/displayport and hdmi bandwidth.

And you're using Preview to do that?


I'm afraid that Preview is singularly unsuitable for anything like that. It's right there in the name - "Preview". Apple sure didn't name it "Colorspace Reference Tool" now did they?


Apple rewrites the app every year. And every year they introduce a new set of obscure bugs in edge case files of all sorts. You're complaining about its display of certain types of lossless jpeg xl files without an alpha channel. Apple's patting themselves on the back because they got PDF to work this year.


Sep 24, 2025 2:59 PM in response to dialabrain

dialabrain wrote:

Well, they are fine on my iMac Pro running Sequoia 15.7.

I have some suspicions, but it would require having access to the exact files.


I think the key is "looking at them at extreme zoom levels". It sounds like Preview is doing some low-level, Metal-based scaling when zooming in low enough to draw four pixels at full screen on a Retina display. That would result in what the OP describes.


Also, I have one machine running 15.6 and another running 26. Is the OP complaining that Tahoe fixed the problem?

Sep 25, 2025 7:53 AM in response to tangyminty

tangyminty wrote:

The top left is preview of the jpeg xl, the top right is the original png the bottom the jpeg xl in another viewer. Note the spurious red spread around the red horizontal line and the leaking of the red in to the area

When I download the image, it arrives as "48edfc0f-3d73-4ca4-a811-dc625c74663c.png", which is clearly just a PNG image. But since that's all you're willing to provide, I'll take it.


I downloaded the libjxl reference implementation and built it from source. Then I converted your PNG into a lossless jpegxl file. I don't see any difference from your original PNG file. I zoomed way in on the window dots.



I'm using macOS Sequoia version 15.6, which meets your "15.7 and earlier" criteria.

Sep 25, 2025 1:22 PM in response to tangyminty

No, the image at the TOP LEFT is preview showing the jpeg xl and is clearly not reproducing the full chroma bandwidth.

Okay, but again - there's no such thing as chroma bandwidth in a still image.


I've opened six different pairs of lossless jpeg xl and png images in Preview, Photoshop and Graphic Converter 12.x. All of them show the images exactly the same. As they should.


Not being able to directly see what you're doing to get that edge on the top left image, I can't guess where that's coming from. All I know is, I can't recreate it using the same apps under the same version of macOS.

Sep 25, 2025 1:57 PM in response to dialabrain

Good grief, I've been messing with this too long. 🤣 I see what you meant.

Hahaha! That never happens to me! 🤪

The thing is, that could be caused by whatever an app uses to convert a png to a jxl, and nothing to do with Preview rendering them.

Agreed. I downloaded Acorn to test. Depending on where I have the settings for a lossy .jxl image, I can cause it to create some dark pixels along the left side, but nothing that heavy. Maybe if I opened and resaved the image several times to compound the error…


Yes, that kind of does it, but you have to put the quality level down pretty low and open/save the image at least a dozen times to get the edge that dark.

Sep 26, 2025 8:35 AM in response to Kurt Lang

Kurt Lang wrote:

Does JPEG XL save space? Yes, but not enough to make anyone jump up and down in rapturous glee. Using lossless, it's slightly better than PNG. But nowhere near enough to make me think about running thousands of stored images through an automated Photoshop action to convert them from TIFF with LZW lossless compression to JPEG XL lossless.

Certain people are very interested in it. The problem is that people don't have to pay by the byte for downloaded data. And people don't have to pay for the data stored on the internet that they want to download. So those people who have petabytes of storage and network transfer costs see a big savings with these new image formats like Jpeg XL and Webp. They don't care that these formats are more resource intensive to decode, because that's something that people do have to pay for by the kilowatt. Then they try to encourage everyone to use these formats from the start so that they don't have to pay for the encoding costs either.


And using the official JPEG XL reference implementation, I'm still unable to reproduce any edge artifacts in a lossless JPEG XL. I just tried again with the real multicolour Apple logo. The cjxl tool did put a funky video colourspace on the JPEG XL version and I can't figure out how to fix that. But aside from the colour being slightly wrong, there are no edge artifacts.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Lossless jpeg xl images not rendering correctly in Preview on macOS 15.7

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.