The blur() function is an inbuilt function in GraphicsMagick library which is used to add blur filter to the image. The function returns the true value on success.
Syntax:
blur( radius, sigma )
Parameters: This function accept two parameters as mentioned above and described below:
- radius: This parameter stores the value of the blur radius.
- sigma: It is an optional parameter which stores the sigma of the object.
Return Value: This function returns blurred Gmagick image.
Original Image:

Example 1:
// Include gm library var gm = require('gm'); // Import the image gm('gfg.png') // Invoke Blur function with blur radius as 12 .blur(10) // Process and Write the image .write("blur1.png", function (err) { if (!err) console.log('done'); }); |
chevron_right
filter_none
Output:

Example 2:
// Include gm library var gm = require('gm'); // Import the image gm('1.png') // Invoke shear function with // xDegrees as 45 and yDegrees as 90 .rotate("#545651", 78) // Invoke blur function with radius // as 5 and sigma as 5 .blur(5, 5) // Process and Write the image .write("blur2.png", function (err) { if (!err) console.log('done'); }); |
chevron_right
filter_none
Output:

Reference:
Recommended Posts:
- CSS | blur() Function
- Wand blur() function - Python
- Wand - blur() function in Python
- Nodejs | Automatic restart NodeJs server with nodemon
- Nodejs | GM monochrome() Function
- Nodejs | GM modulate() Function
- Nodejs | GM whitePoint() Function
- Nodejs | GM whiteThreshold() Function
- Nodejs | GM write() Function
- Nodejs | GM minify() Function
- Nodejs | GM magnify() Function
- Nodejs | GM flop() Function
- Nodejs | GM flip() Function
- Nodejs | GM equalize() Function
- Nodejs | GM enhance() Function
- Nodejs | GM border() Function
- Nodejs | GM bordercolor() Function
- Nodejs | GM drawEllipse() Function
- Nodejs | GM drawPolygon() Function
- Nodejs | GM drawRectangle() Function
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.

