MATLAB: How to convert CMYK image to RGB

Image Processing Toolbox

There is an example on converting RGB to CMYK image in the documentation onĀ "Performing Profile-Based Color Space Conversions" which is as follows:
I_rgb = imread('peppers.png');
inprof = iccread('sRGB.icm');
outprof = iccread('USSheetfedCoated.icc');
C = makecform('icc',inprof,outprof);
I_cmyk = applycform(I_rgb,C);
I would like to know how I can convert CMYK image to RGB.

Best Answer

If the CMYK data is in the same colorspace as the USSheetfedCoated.icc profile (or if it is just to visualize the data), then it is sufficient to reverse the input and output profiles given to MAKECFORM as in the following example:
inprof = iccread('USSheetfedCoated.icc');
outprof = iccread('sRGB.icm');
C = makecform('icc',inprof,outprof);
I_rgb = applycform(I_cmyk,C);
The best results are obtained by using CMYK and RGB profiles that describe the colorspaces of the image and destination device.