How can I convert CMYK image to RGB?

39 views (last 30 days)
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.

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 18 Oct 2013
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.
  1 Comment
Walter Roberson
Walter Roberson on 4 Feb 2016
If the process were exactly reversible, it would follow that any 4 dimensional set of coordinates with finite bounds could be exactly and reversibly mapped into 3 dimensions with finite bounds. Though mind you since the produce of infinities of the real numbers is still the infinity of the real numbers, perhaps that is possible in theory...

Sign in to comment.

More Answers (0)

Tags

No tags entered yet.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!