Skip to main content
Participating Frequently
February 26, 2025

P: Photoshop writes CMYK jpeg2000 file in a way that macOS's Preview.app does not decode correctly

  • February 26, 2025
  • 8 replies
  • 658 views

Photoshop 26.0.0, macOS.

 

1. Open attached psd file

2. cmd-opt-s, jpeg2000, click lossless

 

Expected: Exported jpeg2000 file shows up correctly in Preview.app. Instead, only the top 2x2 pixels look good, and the bottom 2x1 pixels don't. (The exported file does open fine in Photoshop.)

8 replies

Participating Frequently
March 14, 2025

(As in, those last 3 pixels should be purple, not green.)

Participating Frequently
March 14, 2025

Apparently it's not just tiny CMYK images. I have a 119x101 bitmap where the last three pixels on the last row also don't show up correctly in Preview.app (or my decoder) when saved as CMYK JPEG2000 in Photoshop. Photoshop itself displays the JPEG2000 correctly though. (Happy to share the .jp2 file, or a png – but I'm guessing any 119x101 CMYK file will have the same problem.)

BrettN
Community Manager
Community Manager
February 28, 2025

Thanks for the details. I don't know the full details, since this is not something from my team, but I'm not sure we're working with Kakadu. I've logged a ticket and we'll see what more we can find out. 

Participating Frequently
February 27, 2025

Thanks!

 

I'm writing a JPEG2000 decoder, and I'm using this as a test input image 🙂

 

I switched to a 4x2 image for now.

 

I'm seeing this line of black pixels at the bottom in Preview.app, and also in my decoder, which I think follows the spec pretty closely.

 

If I'm creating a 3x2 RGBA image using OpenJpeg's opj_compress and then manually change the color interpretation of that image to be CMYK instead of RGBA, then that file looks fine in Preview.app and my decoder, but broken in Photoshop instead.

 

Maybe kakadu (which Photoshop uses, I think) is buggy with 3x2 CMYK images? Could you raise an issue with them?

BrettN
Community Manager
Community Manager
February 27, 2025

I found the same behavior so I started playing around with it. I have made a couple observations: 

  • Files which are exactly 3 pixels high see this issue, fewer or greater numbers of rows do not see this. What it does is create 3 black pixels in the bottom row, starting from the right. With wider images, those pixels would not overlap any content on the left
  • Files which are 5 or greater pixels wide also see this issue, but it only creates two pixels in the bottom right. Wider than 5 and the 2 pixels are still just attached to the far right edge
    • If the image is 3x5, you get 3 pixels

 

I don't see anything happening like this at larger sized files or other formats

  • What use are these files for?
  • Does your file need to be this small?
  • Does it have to be JPEG2000?
  • Are you seeing similar issues outside of Preview? 
Participating Frequently
February 26, 2025

(If the image is 2x4 instead of 2x3, it works correctly.)

Community Manager
February 26, 2025

Hi there @Kerstin235521410eo6!

Could you please share a screenshot of what you mean by the Preview app not showing the file correctly? If the file opens fine in Photoshop, it might be an issue with the thumbnail generated in the Preview app, and you might need to contact Mac support for that.

Thanks a bunch!

Best, Alek 😊

*(If you mention me with an @, like @Aleke, I’ll get a notification and can respond faster.)*
Participating Frequently
February 26, 2025

I suppose instead of opening the (not) attached .psd file, instead create a 2x3 CMYK bitmap and set the colors as shown below 0 0 0 0, 0 0 0 255

255 0 0 0, 0 255 0 0

0 0 255 0, 255 255 255 0

 

 

 

Participating Frequently
February 26, 2025

…is it not possible to attach psd files here?