The benchmarking conditions
I set up a series of 16 small photos (120x90) from my server and decided to extract the main colors of these. Three aspects have been analysed :
- Ease of use and documentation
As for the rest, the code to test these libraries is so ugly that I will not include it here.
Ease of use
On this point, all three libraries are equal in their minimal (not to say limited) documentation. There may be additional features not listed but who knows...
Despite this, the code is easy enough to understand and what we want now is just a simple color analysis. In all cases, setting up the tests required 5 minutes per libraries on my part, even accounting for small modifications to me made to improve the libraries.
A most fluctuating notion ... In my opinion, such libraries should return the prominent color of an image as seen by a human being of normal constitution. Just to give an example :
On this image, the code should return two kinds of colors, the first being an nuance of green and the second a color between purple and pink.
Colors of image
So Colors of image seems to lag behing on the accuracy aspect. In other cases, both Colors of image and Color Finder are wrong.
Concerning Color finder, the problems comes from the way it extracts the 3 colors, it requires the most used color based on hue then brightness then darkness. So if there are two bright colors that are prominent, then only one will be extracted.
Colors of image seems to make a good calculation but does not take into account the way humans see colors and so finds wrong results.
On this point, things are easier. Both Colors of image and Color Finder need almost 10 seconds to complete the extraction of colors from the 16 photos.
Color extraction, for his part, takes only 2.6 seconds to complete the same job.
And the winner is ...
Color extraction... The only drawback of this library is its relative lack of documentation. For all the other aspects, it is way in front of the others.
One of the features that are easily added to this library is the extraction of all colors with their relative weight in the image. It can be very usefull to compare two images that seem to contain the same colors.