Get a color palette of an image in the DOM

Get most used colors in an image (in the browser). Compatible with browserify.

Demo page

Based on but commonjs compatible and using the quantize module from npm.

npm install colorchart
var colormap = require('colorchart')();
// arg 1 = dom image node to parse
// arg 2 = amount of colors get back
// arg 3 = quality level/accuracy to use in algorithm (default = 10)
var palette = colorchart.get(document.querySelector('img'), 5);
var colorchart = require('colorchart')();
var palette = colorchart.getDominant(document.querySelector('img'));

Go to /example folder and run npm run example-js & npm start for a working example.

MIT licensed