Node.js GM paint() Function
Last Updated :
31 Mar, 2023
The paint() function is an inbuilt function in the GraphicsMagick library which is used to simulate an oil painting. The function returns the true value of success.
Syntax:
paint( radius )
Parameters: This function accepts a single parameter as mentioned above and described below:
- radius: This parameter is used to specify the radius of the paint.
Return Value: This function returns the GraphicsMagick object.
Example 1:
javascript
const gm = require( 'gm' );
gm( '1.png' )
.paint(2)
.write( "paint1.png" , function (err) {
if (!err) console.log( 'done' );
});
|
Output:
Example 2:
javascript
const gm = require( 'gm' );
gm(600, 300, 'white' )
.stroke( "green" , 3)
.font( "Helvetica.ttf" , 60)
.drawText(100, 280, "GeeksforGeeks!" )
.paint(1.2)
.write( "paint2.png" , function (err) {
if (!err) console.log( 'done' );
});
|
Output:
Reference:
Like Article
Suggest improvement
Share your thoughts in the comments
Please Login to comment...