Image Processing on Node.js

node.js image processing libraries

Image processing is a one important part in software development. There are many good libraries like imagemagick, GD for PHP, RMagic for Ruby… But what’s for node.js? Here is a list of image processing library on node.js.

node-canvas

  • I tried it first since I’m quite familiar with <canvas> API. It’s a huge plus for a library.
  • it requires Cairo which doesn’t have an easy Windows download. I found it in GTK+ distribution though.
  • moreover it needs native library binding code to be compiled on module installation. It uses Node-Waf hasn’t being ported to Windows yet.

gm

  • mature
  • runs on Windows smoothly
  • docs are ok but not thorough: I had to look up into source code to figure out what API is available
  • unfortunately there’s no easy way to combine images with gm. Maybe there’s some way to achieve that but I haven’t found one after two hours spent with it.

node-imagemagick

  • The official repo has very few basic ImageMagick commands covered but I used this fork (good thing that NPM can pull libraries directly from git repositories). It has bindings for montage witch does exactly what I need.
  • ImageMagick is quite slow, though it works on Windows.

Node-Vips

  • Huge plus: it uses an incredible VIPS library which I’m familiar with. VIPS is very fast and optimized for large images. It’s very smart about utilizing hardware resources: if your machine has a lot of RAM it’ll do all processing in memory but will switch to hard-drive caches if memory is scarce or required for other applications.
  • same as node-canvas it requires Node-Waf so it’s now available yet for Windows.

(Original from: //stackoverflow.com/questions/10692075/which-library-should-i-use-for-server-side-image-manipulation-on-node-js)

 

Subscription

We will send you a newsletter weekly, includes Coder Read, weekly resources summary, library / application updates & some freebies.

Related Articles

  • Timuric

    Opencv is a big one

  • asdfasds

    node-imagemagick is complete crap. The only reason that it is good is because it appears to work for trivial stuff and its the first thing you find when you look. It is not maintained (not sure about the fork).

    stick with gm if you want to do image/graphicsmagick stuff

    • Jeffrey

      agree !