Mobile app version of vmapp.org
Login or Join
Lengel450

: Different dominant color codes are extracted from same image I try to extract the dominant color from a image by using 3 different tools, i.e.: Tineye Labs Color Theif: http://lokeshdhakar.com/projects/color-thief/

@Lengel450

Posted in: #Color #ImageProcessing #Images #Png

I try to extract the dominant color from a image by using 3 different tools, i.e.:


Tineye Labs
Color Theif: lokeshdhakar.com/projects/color-thief/ Vibrant.js: jariz.github.io/vibrant.js/

However, the result are different after I used them to analysis one same PNG image, e.g., the dominant colors I extracted from the image are:


rgb(185, 199, 123)
rgb(176, 192, 116)
rgb(189, 202, 122)


I wonder why this happened and is there anything I can do to make the results better? Do I need to create a histogram of the image? Do they extract the color by analyzing pixels?

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Lengel450

1 Comments

Sorted by latest first Latest Oldest Best

 

@Cugini998

Dominant color may refer to many things. There is no one formula for getting this value. As such there is no better method, unless you can define what better in your use case means. Since your not providing a use case they are all as good.

The real problem is that a human sees colors differently than a computer take this illusion:

Object to be extended to artboard size web.mit.edu/persci/people/adelson/images/checkershadow/checkershadow_illusion4med.jpg
Image 1: Our brain interprets the B tile lighter than A tile even tough they are as dark. Illusion source, with deeper explanation.

Just doing a naive color search is going to fail. Calculating the most common color would fail in many cases because the image may have lot of slightly discolored hues of same color, because of noise. So the colors have to be binned with some metric, finding these bin cluster centers isn't really a straightforward deal.



Image 2: What is the dominant color of this image? Black 0 0 0 pixels are the most common if you'd just calculate their number. Humans would still say green is most dominant.

In addition the computer should be able to eliminate the effect of light and shadow on the surfaces of the image as this is what human eyes do anything other feels somewhat off. So you should boost the color a bit. How much is a hard to say you would need complex heuristics.

As a result theres no right solution to the problem. Certainly looking at minute differences in RGB values is a bit over the top as most humans can not recognize those colors as different unless they can compare them next to each other. So for all intents and purposes for humans thse represent the about the same color.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme