Compute the Color of the Foto
Posted: 2011-07-25T10:42:03-07:00
Hi there
I have 10 different preset RGB colors (example red, blue, green, etc...).
Now I need to read foto files (.jpg, .gif, .png) and decide to what preset color the images best fits to. Example -> Let's supose on the foto there is a white cloud in the center surrounded by blue sky -> The result should then be the color "white". Or a black dog on a green lawn -> The result should be the color "black".
P.S: Google image search has such a functionality.
I was wondering how such a functionality could be implemented resp. what would be the most "performant" solution. An idea that comes to my mind is to simple resize the images to 3x3 pixel, then read the center pixel and decide what color is closest to it !?
Thx & cheers,
Peter
I have 10 different preset RGB colors (example red, blue, green, etc...).
Now I need to read foto files (.jpg, .gif, .png) and decide to what preset color the images best fits to. Example -> Let's supose on the foto there is a white cloud in the center surrounded by blue sky -> The result should then be the color "white". Or a black dog on a green lawn -> The result should be the color "black".
P.S: Google image search has such a functionality.
I was wondering how such a functionality could be implemented resp. what would be the most "performant" solution. An idea that comes to my mind is to simple resize the images to 3x3 pixel, then read the center pixel and decide what color is closest to it !?
Thx & cheers,
Peter