In this post we’ll create at a multi-threaded application that properly converts CMYK images to RGB. The key here is properly, by which I mean a ‘standard’ conversion to CMYK goes something like:
R = ( (255-C)*(255-K) ) / 255;
G = ( (255-M)*(255-K) ) / 255;
B = ( (255-Y)*(255-K) ) / 255;
…which is simple but unfortunately leaves our images looking pretty awful. The reason is we are not taking into account any color profile information, which means the mapping of say, a green we see in CMYK is not the same green in we’ll get in RGB.
The solution for this problem is to complicate the solution just a touch by employing a third party library called Little CMS to act as the middle-man for the color conversion process.
This comprehensive library does many things you may be interested in, but for us, allows us to employ color profiles during the CMYK -> RGB conversion process. The end result is an RGB images that very closely matches the original CMYK source.