Related Articles

Related Articles

Wand – blur() function in Python
  • Last Updated : 22 Apr, 2020

Blurring Image means making an image fuzzy or hazy. A blur image is indefinite and it is unable to see an image clearly. Blur is of many types, like – Adaptive blur, Gaussian blur, Selective Blur etc. In order to blur an image we use blur() function. blur() function takes three arguments.

Example :

Syntax :

filter_none

edit
close

play_arrow

link
brightness_4
code

wand.image.blur(radius="radius_value"
                  sigma="sigma_value",  
    channel = "optional_channel_value")

chevron_right


Parameters :

Parameter Input Type Description
radius numbers.real the radius of the, in pixels, not counting the center pixel. Default is 0.0.
sigma numbers.real the standard deviation of the, in pixels. Default value is 0.0.
channel basestring Optional color channel to apply blur.

Example #1:



Input Image –

filter_none

edit
close

play_arrow

link
brightness_4
code

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

chevron_right


Output:

Example #2:

Input Image –

filter_none

edit
close

play_arrow

link
brightness_4
code

# import Image from wand.image module
from wand.image import Image
from wand.display import display
  
# read file using Image function
with Image(filename ="human1.jpeg") as img:
  
    # perform blur effect using blur() function
    img.blur(radius = 3, sigma = 4, )
  
    # save final image
    img.save(filename ="blurhuman.jpeg")
    display(img)

chevron_right


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 :