Is NodeJS image processing / analysis possible?

I am running NodeJS on the server side, and I am trying to do a little automatic image processing to determine the "base color" of the image.

Here are the steps I want to take:

  • Take the image (on the remote server, so transferred with the URL) and get its size
  • Use dimensions to calculate the center of the image.
  • Take a rectangle 10px x 50px (WxL) around the center point
  • Get the RGB value for each of these pixels (500 per image)
  • Print average pixel value

I know that such things are possible in PHP, but I would like to use Node. I have seen tutorials on using Node-imagick for basic processing (e.g. resizing and cropping), but I don't know where to start with a more advanced analysis like this.

Questions

(a) Is this possible with Node?

(b) What libraries will allow me to do this?

+7
javascript image image-processing
source share
2 answers

A: yes

B: gm

here are some more characters to do it long enough for stackoverflow ...

+26
source share

node-itk may be useful to you.

node-ITK is a node.js shell that is built on top of ITK. It was created to facilitate the use of noe.js in rapid prototyping, education, and web services for medical imaging.

https://npmjs.org/package/node-itk

0
source share

All Articles