@xvan/gm-palette
Dominant color and palette using graphicsmagick.
Getting started
First download and install GraphicsMagick. In Mac OS X, you can simply use Homebrew and do:
$ brew install graphicsmagick
then use npm to install the module:
$ npm install gm-palette
Features
- Retrieve dominant color and palette.
- GIF format supported.
- Provide the count of palette colors to obtain.
- The input can be path to image, buffer or a readable stream
Basic Usage
const gmPalette = //If callback is not provided, Promise is returned.gmPaletteconst count = 10 // Required number of palette colors.//If callback is not provided, Promise is returned.gmPalette gmPalette
Buffer
const gmPalette = imageBuffer = count = 10 //If callback is not provided, Promise is returned.gmPalette //If callback is not provided, Promise is returned.gmPalette
Stream
const gmPalette = readableStream = fs count = 10 //If callback is not provided, Promise is returned.gmPalette //If callback is not provided, Promise is returned.gmPalette