Skip to content
Related Articles

Related Articles

Improve Article
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 :

ParameterInput TypeDescription
radiusnumbers.Realsize of gaussian aperture.
sigmanumbers.realStandard deviation of the gaussian filter.
channelbasestringApply the sharpen effect on a specific channel. Optional and None by default.

Source Image:

Example 1:






# 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")

Output:

Example 2:
Increasing value of radius and sigma




# 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")

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. And to begin with your Machine Learning Journey, join the Machine Learning – Basic Level Course




My Personal Notes arrow_drop_up
Recommended Articles
Page :