0

So basically my front end is displaying images that are about 3-5mb. I need to find a way to make their size way smaller.

Basically I have the file object on node.js uploading to amazon aws. I just need to compress it before it uploads.

Also whats the best way to resize images on node.js?

Nello
  • 1,737
  • 3
  • 17
  • 24
  • Image files are already compressed (image compression is built into both JPG and PNG formats). You can make them smaller by making them be a lower resolution (fewer pixels) or by reducing the compression quality (decompress and then recompress at a reduced quality). – jfriend00 Jan 15 '16 at 03:56
  • Yea lower resolution – Nello Jan 15 '16 at 03:59
  • 1
    Lots of images resizers for nodejs here: https://www.google.com/search?q=image+resizer+nodejs – jfriend00 Jan 15 '16 at 04:08
  • Put your thoughts on some of them for the answer and I will accept the answer. Also when you answer let me know which one you prefer and also why you picked that specific one. – Nello Jan 15 '16 at 04:15
  • I don't have experience with any of them. I've heard of GraphicsMagick more than the others, but that's all I know. It is also off-topic here on Stack Overflow to ask for opinions on 3rd party libraries. – jfriend00 Jan 15 '16 at 04:18
  • oh okay thanks for your input. – Nello Jan 15 '16 at 04:19

1 Answers1

0

The best way is use Canvas Node js module. This module is up to 3 times faster than ImageMagic.

Images manipulation comparation - https://github.com/ivanoff/images-manipulation-performance

author's results:
  canvas.js : 4.001 img/sec;
  gm-imagemagic.js : 1.206 img/sec;
  gm.js : 1.536 img/sec;
  lwip.js : 0.406 img/sec;
Dimitry Ivanov
  • 213
  • 2
  • 4