6.4.1 • Published 5 years ago

images-manipulation-performance v6.4.1

Weekly downloads
1
License
MIT
Repository
github
Last release
5 years ago

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

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