Color Thief with Jimp for NodeJs
A script for grabbing the color palette from an image. Uses Javascript and the Jimp to make it happen. This fork does NOT use canvas, and is can only used with NodeJs.
Install NodeJs
Install the module via npm
npm install color-thief-jimp --save
And use it:
var ColorThief = ;
How to use
Get the dominant color from an image
var ColorThief = ; // getColor(sourceImage[, quality])var dominantColor = ColorThief;// dominantColor = [intRed, intGreen, intBlue]
Build a color palette from an image
In this example, we build an 8 color palette.
var ColorThief = ; // getPalette(sourceImage[, colorCount, quality])var palette = ColorThief;// palette = [ [intRed, intGreen, intBlue], [intRed, intGreen, intBlue], ... ]
Changelog
2016-02-26
First release.
Credits
Source code based on color-thief (MIT license) by Lokesh Dhakar lokeshdhakar.com