I have about 3,000 images and 13 different colors (the background of most of these images is white). If the primary color of the image is one of these 13 different colors, I would like them to be connected.
I saw similar questions, such as python Image Color Definition , that are asking for an average color algorithm. I copied a lot of this code using the Python image and histogram library, and got it to work, but I believe that it is not too reliable for determining the primary colors.
Any ideas? Or libraries that could solve this problem?
Thanks in advance!
: EDIT: Thank you guys, you pretty much all said the same thing to create βbucketsβ and increase the number of buckets with each nearest pixel in the image. I seem to get a lot of images that return White or Beige, which is also the background on most of these images. Is there any way around or ignoring the background?
Thanks again.
dchang
source share