Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Saving a CMYK image as .jp2/.j2k fails #8062

Open
sl2c opened this issue May 15, 2024 · 1 comment
Open

Saving a CMYK image as .jp2/.j2k fails #8062

sl2c opened this issue May 15, 2024 · 1 comment
Labels

Comments

@sl2c
Copy link

sl2c commented May 15, 2024

When running

Image.open('cmyk.tif').save('out.jp2')

I get:

OSError: encoder error -2 when writing image file

Same with writing to '.j2k'. Same with other CMYK images I tried. I am using Pillow v. 10.1.0.

cmyk.tif.zip

@radarhere
Copy link
Member

I've created uclouvain/openjpeg#1529 as the first step in saving JP2 CMYK images.

Without the colour specification box of JP2, it doesn't seem possible to have a CMYK J2K image.

https://community.intel.com/t5/Intel-Integrated-Performance/JPEG2000-and-CMYK-Data-Not-RGB/td-p/862891

JPEG 2000 encoding doesn't support CMYK coding, mostly because it's an extension of JP2 file container (part 2 of the standard)

https://newsgroup.xnview.com/viewtopic.php?t=29274

the JPEG-2000 standard does not specify any means for encoding color space information in a JPEG-2000 code stream, the decoder must make certain assupmtions about the color space of an image. If accurate color representation is important, the JPEG-2000 code stream format should not be employed. The JPEG-2000 JP2 format should be used instead.

@radarhere radarhere added the JPEG label May 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants