

Show HN: I built color search for iTunes - mbarrett
http://colorhits.com/?c=204,172&g=21

======
dhotson
Very cool! :-)

I built a similar search by color tool at 99designs and wrote a bit about how
it works here: [http://99designs.com/tech-blog/blog/2012/08/02/color-
explore...](http://99designs.com/tech-blog/blog/2012/08/02/color-explorer/)

TL;DR I'm using R-trees to do fast perceptual nearest neighbour color search.

OP, how are you doing it in this?

~~~
mbarrett
Nice walk through on your side.

The color search mechanism is one that I am wanting to rehash. When the album
update script is started, each album's color info is parsed and stored in the
database. During the update, they are also assigned a color group which aligns
with the color selection in the UI. In my implementation the nearest neighbor
was trying to be determined when each album is parsed. Its an area that needs
improved upon but that's basically how its setup.

During the research phase, I referenced a php class for the color parsing, but
ultimately modified it heavily for my use.
[http://www.phpclasses.org/package/5577-PHP-Get-the-most-
used...](http://www.phpclasses.org/package/5577-PHP-Get-the-most-used-colors-
in-an-image.html)

------
jmduke
This thing is just _begging_ for a rainbow where you hover over various points
of the rainbow and it pops up with a relevant album.

If you want to take this one step further, I'd love to see a Chrome plugin
version of this: detect the primary colors of a given page and suggest a
similarly-colored album.

~~~
dhotson
Semi offtopic, have you ever noticed on Chrome's new tab page.. the "most
visited" section uses the dominant color of each page as a highlight?

~~~
skeoh
I believe it actually uses the dominant color of the favicon.

------
tehaaron
It makes me happy when this sort of fun, simple app gets voted up to the front
page of HN. It reminds me that my apps don't need to do a million different
things but that only a couple fun/awesome functions can be elegant and useful.

------
duggieawesome
Fantastic job. The darkest of albums.

[http://colorhits.com/album/407270/This+Is+Spinal+Tap](http://colorhits.com/album/407270/This+Is+Spinal+Tap)

------
mbarrett
OP here, Thanks for the comments. It was a very interesting project to build.
To add a little background, ColorHits is using the iTunes EPF data with about
3.6 million albums available to search.

~~~
aardvark179
it's very good fun, but I think it needs some tweaking. I tried finding albums
by the colours I remember of their covers and failed miserably. So then tried
checking the album covers on iTunes and picking the closest matching colours I
could and still failed. For example Stereolab's Transient Random Noise Bursts
With Announcements has a nice simple cover with very limited colours, but I
couldn't get it to show up.

------
rsgong
Great work. I'm working on palette determination on a project, so I'm curious-
which algorithm/library did you use to parse the album covers?

~~~
dhotson
There are a few approaches for extracting colors from an image.

Shameless plug: I helped write a library called colorific to do it:
[https://github.com/99designs/colorific](https://github.com/99designs/colorific)

More about how it works here: [http://99designs.com/tech-
blog/blog/2012/05/11/color-analysi...](http://99designs.com/tech-
blog/blog/2012/05/11/color-analysis/)

Clustering techniques can also work quite well:
[http://charlesleifer.com/blog/using-python-and-k-means-to-
fi...](http://charlesleifer.com/blog/using-python-and-k-means-to-find-the-
dominant-colors-in-images/)

~~~
rsgong
Nice. The last point in your blog post on emphasizing saturated colors- that's
the business.

------
lalos
Very cool tool! reminds me of this flickr color search
[http://labs.tineye.com/multicolr/#colors=e73843,6abbd3,e84b6...](http://labs.tineye.com/multicolr/#colors=e73843,6abbd3,e84b6e;weights=33,34,33;)

------
c54
Very cool toy/tool, good implementation too

------
carpe171
very cool

could you up the amount of albums that show up per page?

or have an endless page option?

~~~
mbarrett
Definitely, endless scrolling will probably be added in an upcoming release.

------
jfb
This is great.

