There are no built-in MATLAB functions for converting 4-channel CMYK data directly to grayscale. But it can be done in two steps:
Step 1:
Read the original image and convert the data from the CMYK colorspace to the RGB colorspace, using the MAKECFORM and APPLYCFORM functions. This requires an appropriate ICC color profile, such as the "USSheetfedCoated.icc" color profile from the Adobe Systems, Inc. (www.adobe.com).
Using this profile, the conversion can be executed as follows:
I_cmyk = imread('foo.tif');
inprof = iccread('USSheetfedCoated.icc');
outprof = iccread('sRGB.icm');
C = makecform('icc',inprof,outprof);
I_rgb = applycform(I_cmyk,C);
where "foo.tif" is the TIF-file to be converted.
STEP 2:
Use the RGB2GRAY function to convert the resulting RGB image to grayscale:
I_gray = rgb2gray(I_rgb);
Best Answer