A script for grabbing the color palette from an image. Uses Javascript and the canvas tag to make it happen.
Try it online: palette.junglestar.org
Octopal is a GUI work based on:
See a Demo | Read more on lokeshdhakar blog
var colorThief = new ColorThief();
colorThief.getColor(sourceImage);
getColor(sourceImage[, quality])
returns {r: num, g: num, b: num}
In this example, we build an 8 color palette.
var colorThief = new ColorThief();
colorThief.getPalette(sourceImage, 8);
getPalette(sourceImage[, colorCount, quality])
returns [ [num, num, num], [num, num, num], ... ]
npm install
- [Fix] Remove left-over references to Creative Commons License. MIT all-around.
- [Fix] MMCQ lib issues #16 by @nobodypb
- [Fix] Incorrect bower.json main property path. #37 by @chellem, @joscha, @dkushner
- [Fix] Quality less than 1 causes infinite loop #33 by @nteike
- [Fix] MMCQ.quantize(...) can return false or undefined thus breaking the application (#55)[lokesh/color-thief#55] by @mhahmadi
- [Remove] Drop version number from bower.json #70 by @kkirsche
- Embed quantize into color thief file
- Strip out jQuery requirement
- Credit those who helped with edits - Nathan Spady for drag and drop support.