Color Thief is a JavaScript library that can grab dominant colors from a picture.
Color Thief is easy to use and employs the canvas element for generating a color palette from a picture.
The script actually works (see demos in the homepage), and can grab the main colors even from the smallest image.















