Node.js library for stream processing images

I'm building an application that handles image upload, when the image is uploaded I want to make 3 thumbnails of it, and upload them to Amazon S3.

Now what I would like to know if there are libraries that could do this while the image gets uploaded, processed and finally streamed in an asyncronous flow.

The most logic way to solve this problem is to upload the file to the server, once it is finished uploaden, create 3 thumbnails of it, then upload them all to Amazon S3 and remove the uploaded files.

But I don't want any disk I/O to get involved and no storage either.

Try gm lib for nodejs.

In this case you shall download original image to the server first. Then you can send it to gm to create all thumbnails asynchronously.

As an input gm accepts readable stream, so it's no need to save your image first. It returns stream either, so you can send it to S3 directly.

Gm is realy quick and easy to use. It depends on either imagemagick or graphicsmagick lib (my choice is graphicsmagick, because its lighter and quicker).

Unfortunately, gm saves images on disk before processing them, though you will not notice it looking to your code. But it handles all cleanups itself, so you shall not care about it.

I do not think that you will find nodejs image processing lib that completely free from any disk I/O.