Graphicsmagick use in implementing picture processing node

GraphicsMagick is the swiss army knife of image processing. Called Swiss Army knife.

 

Why use it? 1. Free 2 supports up to 88 kinds of image format processing, to achieve stable and efficient level 3 GB

 

The following is a window operation

 

Step One: Download and install graphicsmagick
 
Official website address:   http://www.graphicsmagick.org/

 

Step two: the installation directory to the environment variable
Successful test page is as follows:


<ignore_js_op> 

 

 

3, node calls graphicsmagick achieve picture compression, picture Cut

 

3-1: installation module of node gm

 

[Shell]  plain text view  Copy the code
?
1
npm install gm

 

3-2: Image compression achieved

 

Server core code:
 
<ignore_js_op>
 
Run server-side script:
[JavaScript]  plain text view  Copy the code
?
1
node mg.js 或则 nodemon mg.js

 

Renderings:
Compression ago:
<ignore_js_op>
After compression:

<ignore_js_op> 

3-3: implement image cropping
 
Server core code:
<ignore_js_op>
 
Run server-side script:
[JavaScript]  plain text view  Copy the code
?
1
node mg.js 或则 nodemon mg.js

 

Renderings:
<ignore_js_op>
 

More technical information may concern: gzitcast

Guess you like

Origin www.cnblogs.com/heimaguangzhou/p/11542089.html