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

Return CMYK JPEGs in RGBA32 surface #410

Open
s09bQ5 opened this issue Jan 14, 2024 · 0 comments
Open

Return CMYK JPEGs in RGBA32 surface #410

s09bQ5 opened this issue Jan 14, 2024 · 0 comments

Comments

@s09bQ5
Copy link

s09bQ5 commented Jan 14, 2024

When libjpeg is used to decode JPEG files, every image with 4 components is decoded as CMYK data into a BGRA surface. But the de-facto standard for CMYK in JPEG is to invert the color components. So instead of C, M, Y, and K the stored values are 255-C, 255-M, 255-Y, and 255-K. Since lack of cyan is red, lack of magenta is green and lack of yellow is blue, the picture is basically RGBA over a black background. I therefore suggest to use an RGBA32 surface instead of a BGRA32 surface for 4 component JPEG images.

For testing this file can be used: https://static.universal-music.de/asset_new/6890/195/view/cascada-whatdoyouwant-cover-300cmykjpg.jpg

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant