color-thief-browser

Get the dominant color or color palette from an image (Browser version).

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
color-thief-browser
2.0.28 years ago8 years agoMinified + gzip package size for color-thief-browser in KB

Readme

Color Thief
A script for grabbing the color palette from an image. Uses Javascript and the canvas tag to make it happen. See a Demo | Read more on my blog

How to use

Get the dominant color from an image

```js var colorThief = new ColorThief(); colorThief.getColor(sourceImage); ``` ```js getColor(sourceImage, quality) returns {r: num, g: num, b: num} ```

Build a color palette from an image

In this example, we build an 8 color palette. ```js var colorThief = new ColorThief(); colorThief.getPalette(sourceImage, 8); ``` ```js getPalette(sourceImage, colorCount, quality) returns num, num, num, num, num, num, ... ```

Changelog

v2.0.1 - 2015-10-05

  • 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
  • Remove Drop version number from bower.json #70 by @kkirsche

v2.0.0 - 2013-06-23

  • Embed quantize into color thief file
  • Strip out jQuery requirement
  • Credit those who helped with edits - Nathan Spady for drag and drop support.