Reputation: 143
I have a jpeg image with the colors encoded in the YCCK color space. I have already decoded it in C++ using libjpeg. How can I convert it to RGB?
Converting it to CMYK would also be useful for me, since I know how to convert from CMYK to RGB using ICC color profiles.
Upvotes: 1
Views: 3548
Reputation: 30460
Have a look here.
First, conversion is done into RGB format as:
R = Y + 1.402*Cr - 179.456 G = Y - 0.34414*Cb - 0.71414*Cr + 135.45984 B = Y + 1.772*Cb - 226.816
After that, conversion to CMYK image is performed as follows:
C = 255 – R M = 255 – G Y = 255 – B
The values of K channel are written without modification.
Upvotes: 1