Wand – sketch() function in Python
Sketch is another artistic special effect present in Wand library in python. sketch() function generates a pencil sketched image in output.For best results, radius value should be larger than sigma.
Syntax :
Python3
wand.image.sketch( radius, sigma, angle)
|
Parameter :
Parameter |
Input Type |
Description |
radius |
numbers.Real |
Size of Gaussian aperture. |
sigma |
numbers.Real |
standard deviation of the Gaussian operator. |
angle |
numbers.Real |
direction of blur. |
Source Image:
Example #1:
Python3
from wand.display import display
from wand.image import Image
with Image(filename = "koala.jpeg" ) as img:
img.sketch( 0.5 , 0.0 , 98.0 )
img.save(filename = "rb_koala.jpeg" )
display(img)
|
Output :
Example #2: To get the best result transform image to grayscale image
Python3
from wand.display import display
from wand.image import Image
with Image(filename = "koala.jpeg" ) as img:
img.transform_colorspace( "gray" )
img.sketch( 0.5 , 0.0 , 98.0 )
img.save(filename = "rb_koala.jpeg" )
display(img)
|
Output :
Last Updated :
09 Mar, 2023
Like Article
Save Article
Share your thoughts in the comments
Please Login to comment...