Skip to content
Related Articles

Related Articles

Python – charcoal() method in Wand

Improve Article
Save Article
  • Last Updated : 08 May, 2020
Improve Article
Save Article

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 :

ParameterInput TypeDescription
radiusnumbers.RealThe size of the Gaussian operator.
sigmanumbers.RealThe 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:

My Personal Notes arrow_drop_up
Related Articles

Start Your Coding Journey Now!