ImageMagick does the actual color extraction, then I wrote some code to score those colors against a palette for use in a "search by color" system.
and take your hipster language with you