Bruno Augusto
September 20th, 2010, 06:09 PM
Good evening (at least to me),
I'm not a very well English speaker, but I will try towards to resolve my problem.
I would like some guidelines about how to categorize a RGB color by its proximity, or as I'd read, Color Shade.
Example:
The color #AAFFAA (170,255,170) is, visually, a derivation of pure green (0,255,0).
But how can I do this distinction programatically?
Of course, this is a very easy color, because is, let's say, full of green.
But what if the given color is, for example, #D27A4B (210, 122, 75) - looks like a clay-brown.
The main pure colors are: Red, Green, Blue, how the color above can be classified?
Should I a keep a very refined list of colors, with specific tones of each color and compare by proximity? Or is there something better?
All this is for mapping a terrain image. I'm creating a web game which each player will have a random "feud" (or something like that).
I would like to have a lot of terrains images and assign randomly to each player.
But one of tasks doable by players is Building Constructions and would like to restrict WHERE some buildings can be built.
Example: A Mill can only be constructed over part of terrain specified as"grass", of some kind of plantation. But cannot be built over sidewalk, bridges, mountains...
I've already created the image splitter and I can distinguish the most predominant color of the image, or each "tile", but if I can't classify it programatically, I can't continue.
I tried this (http://www.codeguru.com/forum/showpost.php?p=1000427&postcount=3) formula but I don't know the threshold values.
I found some values here (http://www.polytechfusion.com/ColorThreshold.html) and here (http://www.manifold.net/doc/image_threshold_color.htm), but I think I didn't understood correctly how can I apply this concept to match and posteriorly classify the predominant color of image.
Thanks for helping
I'm not a very well English speaker, but I will try towards to resolve my problem.
I would like some guidelines about how to categorize a RGB color by its proximity, or as I'd read, Color Shade.
Example:
The color #AAFFAA (170,255,170) is, visually, a derivation of pure green (0,255,0).
But how can I do this distinction programatically?
Of course, this is a very easy color, because is, let's say, full of green.
But what if the given color is, for example, #D27A4B (210, 122, 75) - looks like a clay-brown.
The main pure colors are: Red, Green, Blue, how the color above can be classified?
Should I a keep a very refined list of colors, with specific tones of each color and compare by proximity? Or is there something better?
All this is for mapping a terrain image. I'm creating a web game which each player will have a random "feud" (or something like that).
I would like to have a lot of terrains images and assign randomly to each player.
But one of tasks doable by players is Building Constructions and would like to restrict WHERE some buildings can be built.
Example: A Mill can only be constructed over part of terrain specified as"grass", of some kind of plantation. But cannot be built over sidewalk, bridges, mountains...
I've already created the image splitter and I can distinguish the most predominant color of the image, or each "tile", but if I can't classify it programatically, I can't continue.
I tried this (http://www.codeguru.com/forum/showpost.php?p=1000427&postcount=3) formula but I don't know the threshold values.
I found some values here (http://www.polytechfusion.com/ColorThreshold.html) and here (http://www.manifold.net/doc/image_threshold_color.htm), but I think I didn't understood correctly how can I apply this concept to match and posteriorly classify the predominant color of image.
Thanks for helping