color-extract

1.0.0 • Public • Published

Color Extract

Fetch prominent colors from images.

# Extract color schemes via terminal. 
# If --clusters is not defined, the getProminentColors is used 
$ npm install -g color-extract
$ color-extract --input '/path/to/some/file.png' --number 3 --clusters
# Prints ["#141CFC","#04FC7C","#FC2404"] 
// Use it via the module.
import { getKMeansColors, getProminentColors } from 'color-extract';
getKMeansColors('/path/to/some/file.png', 3) .then(colors => winston.info(colors.colors))
getProminentColors('/path/to/some/file.png', 3).then(colors => winston.info(colors.colors));
 
// Top = true: Will seperate the color on the top line of the image.
// This option is only available in getProminentColors, not in getKMeansColors.
getProminentColors('/path/to/some/file.png', 3, true).then((colors) => {
  winston.info(colors.top);
  winston.info(colors.colors);
});

Readme

Keywords

Package Sidebar

Install

npm i color-extract

Weekly Downloads

1

Version

1.0.0

License

MIT

Last publish

Collaborators

  • jense5