3

I am new to node.js.

I´ve read the thread about Node.js Image Libraries and it seems that GM seems to be the most

advanced. I am trying to find out the most dominant color of an image using nodejs.

Then I have found this script color-thief , which is very interesting. It uses canvas to determine the color.

I found this node-canvas, which allows to create server side canvas.

Can I use color-thief and node-canvas together? Or am I missing something? Maybe someone has a better solution for nodejs.

Thanks!

Community
  • 1
  • 1
zer02
  • 3,963
  • 4
  • 31
  • 66

1 Answers1

4

Yep, there is a port for color-thief in node.js.

Get the node.js friendly port here:

https://npmjs.org/package/thief

Install the package like this:

$ npm install thief

Include color-thief in your node script like this:

var thief=require("thief");

And use color-thief normally! ...

Paul Mougel
  • 16,728
  • 6
  • 57
  • 64
markE
  • 102,905
  • 11
  • 164
  • 176
  • I can't find this code on Github, apparently the link is broken. It doesn't install for me because of build issues with the node-gyp. I wonder if there are any other solutions out there that don't require a build. – Chris Mar 04 '14 at 02:19
  • Painfully, I was able to get it to build with Visual Studio 2012 following these instructions: http://programanddesign.com/cpp/installing-node-canvas-on-windows/ – Chris Mar 04 '14 at 03:49