Skip to content
Related Articles

Related Articles

Wand adaptive_sharpen() function in Python

View Discussion
Improve Article
Save Article
Like Article
  • 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:


My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!