Python – sharpen() function in Wand
sharpen() function is used in order to enhance blurry edges into more distinct(sharp) edges. This is achieved using a Gaussian function. The radius value should always less than the standard deviation(sigma). Sharpen effect image more clearer and defined.
Syntax :
wand.image.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 |
Optional color channel to target. Default is none |
Source Image:
Example 1:
from wand.image import Image
with Image(filename = "koala.jpeg" ) as img:
img.sharpen(radius = 8 , sigma = 4 )
img.save(filename = "sharpkoala.jpeg" )
|
Output:
Example 2:
Increasing the value of radius and standard deviation.
from wand.image import Image
with Image(filename = "koala.jpeg" ) as img:
img.sharpen(radius = 16 , sigma = 8 )
img.save(filename = "sharpkoala.jpeg" )
|
Output:
Last Updated :
08 May, 2020
Like Article
Save Article
Share your thoughts in the comments
Please Login to comment...