MATLAB: Find the intensity of the color present in an image especially CYAN, MAGENTA, YELLOW

cmykduplicate postimage processing

i want to find the intensity of color present in an image mainly the CYAN, MAGENTA, YELLOW(out of these colors which color in majorly present in image hopefully in percentage), help me with a way (or method)to find those. image is in tif format

Best Answer

Very important: Images that you see on a computer screen use the RGB colour model. There is no definition of Cyan, Magenta and Yellow in that colour model. RGB is an additive colour model. Images for printing may use the CMYK colour model. This is a subtractive colour model. Both colour models are device dependent and converting between one and the other requires knowing the colorimetry of each device. Moreover the two models do not cover the same gamut so some colours can be represented in one model but not the other.
The fact that you haven't really answered the question in the comments to your question would indicate that you do not understand what colour models are. If you did, you probably wouldn't even asked your question.
However, a TIFF image can store an image already converted to the cmyk colour model for a specific device. You can see if your image is using the cmyk model with imfinfo, ColorType will be 'CMYK'. If it is the case, then:
img_cmyk = imread(yourtiffile);
cyan = img_cmyk(:, :, 1);
magenta = img_cmyk(:, :, 2);
yellow = img_cmyk(:, :, 3);
black = img_cmyk(:, :, 4);
If however the ColorType returned by imfinfo is 'RGB', then you'll have to follow the process outlined in this help page to convert between the two models. this requires that you have colorimetry information for both the source and destination device.
edit: Went a bit enthusiastic on the colons!