Python – charcoal() method in Wand
charcoal() generates a sketch kind of image of original image. A very similar image to edge extraction is generated with inverted colours. One of the artistic simulations, charcoal() can emulate a drawing on paper.
Syntax :
wand.image.charcoal(radius, sigma)Parameters :
Parameter Input Type Description radius numbers.Real The size of the Gaussian operator. sigma numbers.Real The standard deviation of the Gaussian.
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: # Charcoal fx using charcoal() function img.charcoal(radius = 1.5 , sigma = 0.5 ) img.save(filename = "ch_koala.jpeg" ) |
Output:
Example 2: Increasing radius and sigma value.
# Import Image from wand.image module from wand.image import Image # Read image using Image function with Image(filename = "koala.jpeg" ) as img: # Charcoal fx using charcoal() function img.charcoal(radius = 4 , sigma = 0.65 ) img.save(filename = "ch_koala_2.jpeg" ) |
Output: