

Extracting Colors With Colorific - dhotson
http://99designs.com/tech-blog/blog/2012/05/11/color-analysis/

======
ZenPsycho
It would be nice if there was some acknowledgement of previous work in this
area like the median cut algorithm <http://en.wikipedia.org/wiki/Median_cut>
the neuquant algorithm <http://members.ozemail.com.au/~dekker/NEUQUANT.HTML>

or the dozens of other image to palette services a google search away
(including one that google uses itself for image search)

So, maybe an explanation of why this is better than those, different from
those, a comparison of sorts. Or would it be better if some third party did
this "benchmarking" work eh?

specifically, I am concerned that this approach is based on tiny micro-
heuristics based on specific images and not a robust statistical model of
human perception.

edit: here's another (I may use this comment to continue collecting existing
algorithms) <http://www.springerlink.com/content/f002412013877333/>

~~~
mrmaddog
I feel like k-means in in Lab color space would lend itself well here too.
Either by picking a large k that you then narrow down by picking the highest
contrast colors, or instead by running k-means multiple times with different
k's until you get an error threshold that is tolerable and results that have a
high enough contrast. K-means is also a pretty easy algorithm to
understand/implement.

~~~
drifkin
Google uses k-means clustering in Chrome on their new tab page (though they
use RGB). The most visited section shows a color strip below each site, with a
color chosen from the site's favicon.

Here's the code:
[http://src.chromium.org/svn/trunk/src/ui/gfx/color_analysis....](http://src.chromium.org/svn/trunk/src/ui/gfx/color_analysis.cc)

~~~
drifkin
It turns out the header file actually has a pretty nice explanation of the
algorithm:

[http://src.chromium.org/svn/trunk/src/ui/gfx/color_analysis....](http://src.chromium.org/svn/trunk/src/ui/gfx/color_analysis.h)

------
trun
This is really neat. One of my favorite Windows design features (there aren't
many) is the way icons in the taskbar are highlighted with their primary color
when you mouseover. This seems like the perfect solution to replicate that
effect elsewhere.

~~~
EtienneK
I noticed the other day that Ubuntu's Unity also does this. It's a very nice
feature.

------
johnx123-up
How is this different from ImageMagick? <http://valokuva.org/?p=72> (really
asking)

------
SkyMarshal
Very awesome.

Google's logo has 255 colors (including shades). With most other companies I
might consider that to be a coincidence.

~~~
chime
255 is not because Google designers chose 255 specific shades but rather the
limitation of 8-bit GIF color palette.

~~~
joshu
<https://www.google.com/images/srpr/logo3w.png>

~~~
flixic
256 (not 255) color palette also applies to 8-bit PNGs.

------
blvr
For problem 3: Why exclude all greys? If you asked me what colour that logo
was I'd say black/red/white/grey, not red/dark red.

~~~
dhotson
Yep, you're right. It's difficult to differentiate greys that are important vs
those that we don't care about. Our current solution works not too badly and
gives us results that are more visually appealing, but I agree we could do
better.

I'd like to try ranking greys lower somehow.. maybe some kind of weighting by
saturation could help.

------
callmeed
I'd like to find or make a ruby version of this.

~~~
dsucher
Are you actually working on this? Because if not, I'm tempted! Just don't want
to duplicate effort here.

------
philjackson

        $ echo myimage.png | colorific
    

Seems a slightly odd way to get filenames.

~~~
dhotson
It's because we're running this over millions of images. We don't want to pay
the startup cost each time.

