0
votes

I'm creating a program which draws the histograms of a certain photo (bitmap).

I start from a Bitmap image, which gets and draws the histogram of that bitmap. Next I do a contrast stretch (which shows the result of the photo and the new histogram). My program also provides the picture with only R, G or B values (also draws the histogram of those).

Now I am at the part where I am stuck. I want to convert the RGB values to the CMYK values. I have a method for that, but I can't draw the resulting picture out of these CMYK values (for example: picture only with cyan value, pictures only with magenta value, etc.).

For as far as I know, it doesn't seem to draw the bitmap with the CMYK color model.

Now my question is, is there a possible way to draw the bitmap picture with only the cyan values? And is it possible without any libraries? If not, which librar(y)ies should I use?

Update:

Histogram of Yellow channel

Could this be the right histogram for the Yellow channel? Or do I still need to do some other calculation for it?

1
It's difficult to tell if the histogram is correct or not from the image you posted... can you provide more details? - AlBal

1 Answers

1
votes

If you want to plot only the cyan values, and assuming you want shades ranging from white to 100% cyan, then you can use RGB values as follows: For 100% cyan use RGB 0,255,255 For 100% white (i.e. zero cyan) use RGB 255,255,255 For intermediate values use RGB 255-cyanValue,255,255 (where cyanValue = the value for cyan assuming a range of 0 to 255).

This works for magenta and yellow also, but based on RGB 255,0,255 and 255,255,0 respectively.

For K, just vary all RGB values from 0,0,0 to 255,255,255.

Hope that makes sense.