News for hackers. Stuff that matters.
Re:Extracting Colors With Colorific by mrmaddog on Friday May 11, 2012 @02:30AM (#3958005)
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.
Re:Extracting Colors With Colorific by drifkin on Friday May 11, 2012 @04:14AM (#3958231)
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....

Re:Extracting Colors With Colorific by drifkin on Friday May 11, 2012 @04:42AM (#3958288)
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....

Re:Extracting Colors With Colorific by mixonic on Friday May 11, 2012 @08:13AM (#3958813)
I am going to straight up lift that idea into a web app I've built. Providing users a hint more context about their content makes interfaces less bland and anonymous. Thanks for raising it!
Re:Extracting Colors With Colorific by dhotson on Friday May 11, 2012 @03:35AM (#3958148)
We haven't tried clustering yet, but I'm keen to.

Correct me if I'm wrong, but by using clustering you might end up with colors that didn't actually occur in the original design right?

In our case we wanted to make sure we found colors that the designer actually chose. I'll have to try this..

Re:Extracting Colors With Colorific by isani on Friday May 11, 2012 @04:04AM (#3958211)
K-means clustering gives you a set of centroids which are the calculated means of each cluster. If you only want actually occurring colors, just look up the color closest to each centroid.
Re:Extracting Colors With Colorific by joshu on Friday May 11, 2012 @02:54AM (#3958057)
that's what i was thinking, as well. of course the problem with k-means is figuring out the number of clusters...