I need to resize the image.So in the below three libraries how to find which one is taking less time to resize the image.
https://github.com/rsms/node-imagemagick
https://github.com/mash/node-imagemagick-native
https://github.com/aheckmann/gm
Sample code
var im = require('imagemagick');
var sourcePath='/tmp/Images/1.jpeg';
var destinationPath='/tmp/ResizedImages/resized.png';
im.resize({
srcPath: sourcePath,
dstPath: destinationPath,
width: 90,
height:100,
},function(err,res){
if(err){
console.log('Error while resizing image '+err);
return;
}
console.log('Image resized successfully...');
});
I have been investigating the same question myself. Here is a benchmark of different software to do image resizing:
http://www.vips.ecs.soton.ac.uk/index.php?title=Speed_and_Memory_Use
Personally I would suggest that you use the https://github.com/aheckmann/gm library, because it runs approximately 1.5-5 times faster than imagemagick according to this:
http://www.admon.org/graphicsmagick-vs-imagemagick/ (cant post more than two links. reputation)
Good luck, I went for graphicsmagick myself.