Node.js GM emboss() Function
Last Updated :
29 Mar, 2023
The emboss() function is an inbuilt function in the GraphicsMagick library which is used to emboss an image which means that each pixel of the image is replaced to give a 3D effect. The function returns the true value of success.
Syntax:
emboss(radius)
Parameters: This function accepts a single parameter as a radius which is used to specify the embossing radius.
Return Value: This function returns the GraphicsMagick object.
Example 1:
javascript
const gm = require( 'gm' );
gm( '1.png' )
.emboss(12)
.write( "emboss1.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!" )
.borderColor( "Green" )
.border(62, 32)
.emboss(3)
.write( "emboss2.png" , function (err) {
if (!err) console.log( 'done' );
});
|
Output:
Reference:
Share your thoughts in the comments
Please Login to comment...