This project has moved. For the latest updates, please go here.

Need the CMYK Values from a pixel...

Jun 13, 2013 at 11:44 AM
Hi all,

need a little Help...

img = New MagickImage(filePath)

i need the cmyk values from this img.. img.TotalColors in my solution there are 5 colors..
Where can i read the values from it...

another way is to check all pixels in the image but there i have some problems too.
there are 5 channels in each pixel? How can i handle it? how can i convert it to cmyk?

Jun 14, 2013 at 5:22 AM
Are you using the method MagickImage.GetReadOnlyPixels? When you get one of the Pixel instances you can access the individual channels. Your image has 5 channels which means you have a CMYKA image (cmyk image with an alpha channel.. Each letter represents one channel, C = 0, M = 1, etc... So if you want to get the Cyan (C) value of your pixel you should get the value of the first channel (index 0).

Maybe i should add some methods to convert a Pixel instance to a MagickColor instance...