How to get the dominant color or color palette from an image in JavaScript

Try the Color Thief which created by Lokesh Dhakar. It extracts color palette using MMCQ(modified median cut quantization) algorithm.
http://lokeshdhakar.com/color-thief/

myImage = $('#myImage');
dominantColor = getDominantColor(myImage);
paletteArray = createPalette(myImage, 10); // 2nd argument sets # of colors in palette

Demo
http://lokeshdhakar.com/projects/color-thief/

License
MIT License

Requires
HTML5 Canvas available environment.

One clap, two clap, three clap, forty?

By clapping more or less, you can signal to us which stories really stand out.