I'm working on my Final Bachelor Project in Computer Science and for now I'm in a dead end. Here is what I got stuck on:
I'm trying to classify any color (rgb code) in any of 8 (eight) simple colors. In short terms I need to find 8 intervals where any colour can be placed and be considered a basic color (red, blue, green, black, yellow, purple, grey, brown ).
example:
(18,218,23) to be classified as "green"
(81,,214,85) also "green"
but
(15,52,16) needs to be "black"
(110,117,110) needs to be "grey"
So there are 256 x 256 x 256 possible colors and I need to divide them in 8 (intervals) basic colors.
I'm waiting for some suggestions.
Cheers !
To be clear (as I've seen in comments) I'm looking for a particular set of 8 colors (red, black, green, brown, blue, purple, grey, yellow). Sorry for the orange above !
Don't do this in RGB, convert to a more convenient color space HSV is probably easiest - then the 8 "colors" are simply 8 intervals along the Hue axis.
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