Serch images by color

Recently I found very interesting thing - google image search implementes searching by colour - you select the colour and get images that match it. Results are VERY relevant. The same thing is done on the shutterstock.com (http://www.shutterstock.com/cat.mhtml?lang=en&searchterm=&anyorall=all&search_cat=&search_group=all&orient=all&photographer_name=&searchtermx=&safesearch=1&show_color_wheel=1&color=%23ff54df)

The question is - how this is done? What is the approach for this?

I think this is a very useful tool for price comparison websites (I’m working at one of them currently), so I’d like to know how to do this.

I think some kind of color reduction filter is applied. Then palette is extracted from an image and saved to DB. Also it seems that they are saving amount of pixels filled with a colors from a palette.

Then you have values like this:

image1

#fff 123

#000 299

#f0c 233

and can compare images based on it.

Good idea. But I think there should also be some jind of "approximate" search. e.g. user selects #ff05AD and image contains 80% of #ff05AE which is actually nearly the same colour…

Any more info or articles on this topic?

Of course you should use quantization first for both image searched and the parameter color you are searching for. It’s described in various captcha breaking techniques.