Skip to content
Related Articles

Related Articles

Python – Adaptive Blur in Wand

View Discussion
Improve Article
Save Article
  • Last Updated : 18 Oct, 2021
View Discussion
Improve Article
Save Article

Adaptive Blur is a kind of blur. The only difference is that blur intensity around the detectable edges in image is less while, it is greater on areas without edges. Adaptive Blur can be done using adaptive_blur function. 
 

 

Syntax : 
 

Python3




wand.image.adaptive_blur(radius="radius_value",
                           sigma="sigma_value",
            channel = "optional_channel_value")
 
# radius should always be greater than sigma(standard deviation)

Parameters : 

 

ParameterInput TypeDescription
radiusnumbers.realthe radius of the, in pixels, not counting the center pixel. Default is 0.0.
sigmanumbers.realthe standard deviation of the, in pixels. Default value is 0.0.
channelbasestringOptional color channel to apply blur.

Example #1: 
 

 

Python3




# import Image from wand.image module
from wand.image import Image
 
# read file using Image function
with Image(filename ="gfg.png") as img:
    # perform adaptive blur effect using adaptive_blur() function
    img.adaptive_blur(radius = 8, sigma = 4)
    # save final image
    img.save(filename ="adblur_gfg.png")

Output: 
 

 
Example #2: 
 

 

Python3




# import Image from wand.image module
from wand.image import Image
 
# read file using Image function
with Image(filename ="koala.jpeg") as img:
 
    # perform adaptive blur effect using adaptive_blur() function
    img.blur(radius = 8, sigma = 3)
 
    # save final image
    img.save(filename ="adblur_koala.jpeg")

Output: 
 

 


My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!