You have to define what "intensity" means to you and then find a way to compare the value of the pixel with that "intensity" definition.You'll need to provide a lot more information than this if you want a better answer.

1 solution

Solution 1

There are several color models, also known as color spaces[^] (http://en.wikipedia.org/wiki/List_of_color_spaces_and_their_uses[^]). A pixel can be represented in any of them - but not all colors are present in all color spaces. A color space defines components of a color. On a general monitor screen you use RGB (red-green-blue) but for example the color model used in typography is the CMYK (cyan-magenta-yellow-black). But there are more. An image file on your computer is most likely in RGB or CMYK.

Than what is the problem? The intensity of a pixel is the value of any of the R,G or B components (supposing RGB(A)), or the value of the color itself if it is a 8bppx image. Here is a sample about PixelFormat property and how to access pixels: http://msdn.microsoft.com/en-us/library/system.drawing.image.pixelformat.aspx, and the Color class contains methods to access color components, even simple color space transformations.

Where are this float values coming from? If you look at the link about the RGB to HSI conversion, it is as easy as this: I=(R+G+B)/3But the Color class gas a GetBrightness method that could be also good for you.

Yes. As I said you have more options. Intensity from HSI, Value from HSV, Brightness from HSB or even Luma/Luminescence are good choices. In a practical situation it would depend on the image source and your final goals.