Open In App

Wand adaptive_sharpen() function in Python

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:




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


Article Tags :