Socket
Socket
Sign inDemoInstall

images-manipulation-performance

Package Overview
Dependencies
438
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    images-manipulation-performance

Compare Nodejs image processing libraries


Version published
Weekly downloads
25
decreased by-19.35%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

Node.js images manipulation performance

Compare Node.js's modules for images processing request

v6.4.1

Preamble

The fastest way to get the results is

git clone https://github.com/ivanoff/images-manipulation-performance.git

cd images-manipulation-performance

docker-compose up

Image processing packages list

  • canvas v.2.6.0, source
  • canvas v.1.6.13, source
  • easyimage v.3.1.1, source
  • gm v.1.23.1, source
  • image-js v.0.21.7, source
  • imagemagick v.0.1.3, source
  • jimp v.0.6.8, source
  • sharp v.0.23.0, source

Deprecated packages

Dependencies

Modules instalation

node-canvas

Please, read extra instructions how to install node-canvas module here.

For example, you can quickly install the dependencies by using the command for your OS:

OSCommand
OS Xbrew install pkg-config cairo pango libpng jpeg giflib librsvg
Ubuntusudo apt-get install build-essential libcairo2-dev libpango1.0-dev libjpeg-dev libgif-dev librsvg2-dev
Fedorasudo yum install gcc-c++ cairo-devel pango-devel libjpeg-turbo-devel giflib-devel
Solarispkgin install cairo pango pkg-config xproto renderproto kbproto xextproto
OpenBSDdoas pkg_add cairo pango png jpeg giflib
WindowsSee the wiki
OthersSee the wiki

gm

OSCommand
OS Xbrew install imagemagick graphicsmagick
Ubuntusudo apt-get install imagemagick graphicsmagick
Fedorasudo yum install imagemagick graphicsmagick
Solarispkgin install imagemagick graphicsmagick
WindowsInstructions on graphicsmagick

Installing

Please read Modules instalation section before.

git clone https://github.com/ivanoff/images-manipulation-performance.git

cd images-manipulation-performance

npm install

Testing

npm test

Using

IN=<source_folder> OUT=<result_folder> node src/index.js

where <source_folder> is foulder where original images are stored, <result_folder> is folder, where result images will be saved.

for example:

IN=static/original OUT=static/result node src/index.js

Result example

Images found: 10
Modules found: 8
List of modules: canvas.js, easyimage.js, gm-imagemagic.js, gm.js, image-js.js, jimp.js, sharp-simd.js, sharp.js
Time for cooling down before each modulle, sec: 60
== START ==
name;images/sec;time spent, sec;minCPUidle;minFreeMem, Mb;MaxLoadAvg
canvas1.js;1.802;55.483;94%;569;1.14
canvas2.js;6.660;15.015;94%;578;0.70
easyimage.js;2.269;44.063;94%;580;1.57
gm-imagemagic.js;4.944;20.226;94%;580;1.68
gm.js;5.581;17.919;94%;580;1.48
image-js.js;0.984;101.661;94%;536;1.05
jimp.js;0.716;139.670;94%;514;1.86
sharp-simd.js;10.575;9.456;94%;510;0.97
sharp.js;11.163;8.958;94%;495;0.64
== END ==
nameimages/sectime spent, secminCPUidleminFreeMem, MbMaxLoadAvg
canvas1.js1.80255.48394%5691.14
canvas2.js6.66015.01594%5780.70
easyimage.js2.26944.06394%5801.57
gm-imagemagic.js4.94420.22694%5801.68
gm.js5.58117.91994%5801.48
image-js.js0.984101.66194%5361.05
jimp.js0.716139.67094%5141.86
sharp-simd.js10.5759.45694%5100.97
sharp.js11.1638.95894%4950.64

In this example you can see, than sharp module is the best, regards to speed of processing of images (~9 images per second on my local computer)

Images per second

License

Licensed under MIT License.

Created by

Dimitry, 2@ivanoff.org.ua .$ curl -A cv ivanoff.org.ua

Keywords

FAQs

Last updated on 04 Sep 2019

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc