imagemagick-stream

Streaming Imagemagick api

imagemagick-stream

Streaming imagemagick api

$ npm install imagemagick-stream
var im = require('imagemagick-stream');
var in = fs.createReadStream('image.png');
var out = fs.createWriteStream('image-resized.png');
 
var resize = im().resize('200x200').quality(90);
 
in.pipe(resize).pipe(out);
 
// Alternatively 
im('image.png')
  .resize('200x200')
  .quality(90)
  .pipe(out);
 
// Or 
im('image.png')
  .resize('200x200')
  .quality(90)
  .to('image-resized.png');

For freehand settings and operations, use .op() and .set(). See the imagemagick docs a list of available options.

im('image.png')
  .set('density', 400)
  .set('channel', 'RGB')
  .resize('200x200')
  .op('gaussian-blur', 0.05);

MIT