I want to find specific colours in a image generally red green blue orange white black maroon etc. But there are alot of colors in a image. RGB has 256x256x256 range. The problem is I do not have any idea that what range of RGBs Combinations makes any specific colour. For Example, if I want to find black color I can try finding the pixels with RGB range within this [0, 0, 0], [10, 10, 10]. Any idea or trick ?
That's pretty easy. All over the web there are color matching resources that can even come up with a name for your color combinations. You have to decide how close to whatever "color" you want. Traditionally colors are given in hex so 0xFFFFFF is brightest white and 0x000000 is darkest black the first 2 digits are the red, the next 2 the green, and the final two blue. So pure red is 0xFF0000, green is 0x00FF00 and blue is 0x0000FF. Colors within 10 or so of another color are pretty close to that same color, with a bit of variation depending on your eye, the human eyes sensitivity to light and the ability of your display device to reproduce the full range of visible light (called the color gamut). So while 0x000000 is black, 0x101010 is also quite dark, whereas 0x202020 is a very dark grey etc. The colors of course all blend into one another. Hope this helps.
In this page you can find the differents gradations of primary colors. I suggest you to use this value to set the minimum and the maximum value of red, green, blue which you can use to do what you want. Page link
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With