What packages are available for node.js to do image cropping?


Question

I'm creating a website using node.js. I have seen many libraries mentioned that piggy back on top of imagemagick etc. There is a list here: https://github.com/ry/node/wiki/modules#graphics

What I'm trying to do is take the image that a user uploads, crop it/size it to certain dimensions the site requires. What is the best/most active script to do this? I'd like one with npm support. Does anyone have actual experience using some of these?

1
32
11/11/2012 6:06:23 AM

Accepted Answer

Think I found a decent imagemagick wrapper that can handle this pretty well. Even in memory before writing the file to disk. (aka user upload -> node imagemagick lib -> cdn and never touching the disk ... which is what I want)

https://github.com/rsms/node-imagemagick

26
12/27/2010 7:55:57 PM

For anyone who is trying to do decide between Canvas and ImageMagick, I just tried both for comparison, and I'm getting much better results from imagemagick. Here's an image that was resized and cropped from 1024x768 to 128x128:

http://i.imgur.com/tfeft.png


Licensed under: CC-BY-SA with attribution
Not affiliated with: Stack Overflow
Icon