Skip to content
Related Articles

Related Articles

Python – Adaptive Blur in Wand
  • Last Updated : 22 Apr, 2020

Adaptive Blur is a kind of blur. The only difference is that blur iintensity 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 :




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:






# 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:




# 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:

Attention geek! Strengthen your foundations with the Python Programming Foundation Course and learn the basics.

To begin with, your interview preparations Enhance your Data Structures concepts with the Python DS Course.

My Personal Notes arrow_drop_up
Recommended Articles
Page :