Detecting the most dominant color in a single image has been discussed in many posts, including:
- Python - Find dominant/most common color in an image
- Fast way of getting the dominant color of an image
but is there a way to find the most dominant color for each image, when given multiple images? I'm looking for an approach where we use all of the images jointly in order to more intelligently determine the dominant color for each image, rather than finding the dominant color for each image individually.
Here is an example image containing multiple objects with similar shapes, but with different dominant colors (in reality each object is contained within a single image file, but I've horizontally concatenated 4 image files into a single file for simplicity's sake).
I "could" in theory concatenate all of the image file and then get a palette of prominent colors using tools such as Color Thief, but then I would have to:
- associate each color back to the original image, and
- remove any shared non-dominant colors (e.g. gray/silver in the image above)
Is there a simpler way of solving this problem?