Archive for September, 2010

Converting CMYK to RGB In Qt Using Little CMS :: Part 1

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.

Read More

Linking libjpeg and Boost+GIL in Qt and X-Code

In this post I’d like to share my experiences of linking an external library and code files to an X-Code and Qt project. This task, more than anything, requires a good deal of “glue” information, that is, knowing how and when to do this or that little task to get to the next stage. It’s not too hard, but can be quite time consuming as you scour the net for hints. Hopefully this single write-up will help others.

Read More