How does node-imagemagick compare with node-gm?

I want to resize photos, crop photos, etc. What all.

But I need to deal with PNG and transparent png.

Which should i use?

+5
source share
2 answers

Well, they both need other software installed on your OS (be it GraphicsMagick or ImageMagick), but node-gm has a more nice api, for example:

// crazytown
gm('/path/to/my/img.jpg')
.flip()
.magnify()
.rotate('green', 45)
.blur(7, 3)
.crop(300, 300, 150, 130)
.edge(3)
.write('/path/to/crazy.jpg', function (err) {
  if (!err) console.log('crazytown has arrived');
})

Another node-imagemagick module has 4-5 functions, and for the rest you can pass parameters.

In terms of performance, you should compare ImageMagick with GraphicsMagick, some useful links here:

http://www.graphicsmagick.org/benchmarks.html
http://www.admon.org/graphicsmagick-vs-imagemagick/
http://news.ycombinator.com/item?id=886010

, GraphicsMagick ImageMagick.

+15

All Articles