0

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...');


});
sachin
  • 13,605
  • 14
  • 42
  • 55
  • 1
    possible duplicate of [How to measure execution time of javascript code with callbacks](http://stackoverflow.com/questions/10617070/how-to-measure-execution-time-of-javascript-code-with-callbacks) Are you asking people to code for you, or you have some specific issues? Please share specific issue you are facing. – moka Jul 16 '13 at 11:06

1 Answers1

1

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.