Related Articles

Related Articles

Wand adaptive_sharpen() function in Python
  • Last Updated : 08 May, 2020

Adaptive Sharpen is similar to normal sharpening but the only difference is sharpen the image more intensely around the pixels with detectable edges, and less intensely away from the edges. Hence output image is more defined and clearer than normal sharpen.

Syntax :

wand.image.adaptive_sharpen(radius, sigma, channel)

Parameters :

Parameter Input Type Description
radius numbers.Real size of gaussian aperture.
sigma numbers.real Standard deviation of the gaussian filter.
channel basestring Apply the sharpen effect on a specific channel. Optional and None by default.

Source Image:

Example 1:



filter_none

edit
close

play_arrow

link
brightness_4
code

# import Image from wand.image module
from wand.image import Image
  
# Read image using Image function
with Image(filename ="koala.jpeg") as img:
  
    # generating sharp image using adaptive_sharpen() function.
    img.adaptive_sharpen(radius = 8, sigma = 4)
    img.save(filename ="askoala.jpeg")

chevron_right


Output:

Example 2:
Increasing value of radius and sigma

filter_none

edit
close

play_arrow

link
brightness_4
code

# import Image from wand.image module
from wand.image import Image
  
# Read image using Image function
with Image(filename ="koala.jpeg") as img:
  
    # generating sharp image using adaptive_sharpen() function.
    img.adaptive_sharpen(radius = 20, sigma = 10)
    img.save(filename ="askoala2.jpeg")

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 :