huey

A little utility that finds the dominant colour of an image and returns it as an RGB array.

npm install huey
3 downloads in the last week
36 downloads in the last month

huey

huey is a little utility that finds the dominant colour of an image and returns it as an RGB array. It now works on the server as well as in the browser, and there’s also a command-line version.

Demonstration

http://michaelrhodes.github.io/huey/


Build status

Browser support

Install

$ npm install [-g] huey

Usage

Browser & Server

huey('./image.jpg', function(error, rgb, image) {
  var red = rgb[0]
  var green = rgb[1]
  var blue = rgb[2]

  // In case you want to do something
  // with the raw image data.
  console.log(
    image.data,
    image.height,
    image.width
  )
})

CLI

$ huey /path/to/image
=> rgb(x, x, x)

License

MIT

npm loves you