How can I convert CMYK image to RGB?

12 visualizzazioni (ultimi 30 giorni)
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.

Risposta accettata

MathWorks Support Team
MathWorks Support Team il 18 Ott 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 Commento
Walter Roberson
Walter Roberson il 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...

Accedi per commentare.

Più risposte (0)

Tag

Non è stata ancora inserito alcun tag.

Community Treasure Hunt

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

Start Hunting!

Translated by