Python – motion_blur() in Wand
Last Updated :
09 Mar, 2023
Another kind of blur we can perform in Wand is Motion Blur. In this kind a Gaussian blur is performed in a single linear direction and it appears like image is moving in a linear direction. It takes a new angle parameter.
Syntax :
Python3
wand.image.motion_blur(radius = radius_value, sigma = sigma_value,
angle = angle_value, channel = "optional_channel_value" )
|
Parameter :
Parameter |
Input Type |
Description |
radius |
numbers.Real |
the radius of the, in pixels, not counting the center pixel. |
sigma |
numbers.Real |
the standard deviation, in pixels |
angle |
number.Real |
Apply the effect along this angle. |
channel |
basestring |
Optional color channel to apply blur. |
Image Used :
Example 1:
Python3
from wand.display import display
from wand.image import Image
with Image(filename = "koala.jpeg" ) as img:
img.motion_blur(radius = 16 , sigma = 8 , angle = 90 )
img.save(filename = "mb_koala.jpeg" )
display(img)
|
Output :
Example 2: increase radius, sigma and changed angle to 45.
Python3
from wand.display import display
from wand.image import Image
with Image(filename = "koala.jpeg" ) as img:
img.motion_blur(radius = 22 , sigma = 10 , angle = 45 )
img.save(filename = "gb_koala.jpeg" )
display(img)
|
Output :
Like Article
Suggest improvement
Share your thoughts in the comments
Please Login to comment...