Node.js: image resizing without ImageMagick

前端 未结 12 1642
离开以前
离开以前 2020-12-22 18:56

I\'m developing a web app on Node.js (+ express 4) where users can set their profile image by uploading it to the server. We already limit the file mimetype and max filesize

12条回答
  •  既然无缘
    2020-12-22 19:09

    Canvas is 2.3 times faster than ImageMagic.

    You can try to compare Node.js modules for images manipulation - https://github.com/ivanoff/images-manipulation-performance

    author's results:
     sharp.js : 9.501 img/sec; minFreeMem: 929Mb
     canvas.js : 8.246 img/sec; minFreeMem: 578Mb
     gm.js : 4.433 img/sec; minFreeMem: 791Mb
     gm-imagemagic.js : 3.654 img/sec; minFreeMem: 804Mb
     lwip.js : 1.203 img/sec; minFreeMem: 54Mb
     jimp.js : 0.445 img/sec; minFreeMem: 82Mb
    

提交回复
热议问题