Skip to content
Related Articles

Related Articles

Python – charcoal() method in Wand
  • Last Updated : 08 May, 2020

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:

 Attention geek! Strengthen your foundations with the Python Programming Foundation Course and learn the basics.  

To begin with, your interview preparations Enhance your Data Structures concepts with the Python DS Course. And to begin with your Machine Learning Journey, join the Machine Learning – Basic Level Course

My Personal Notes arrow_drop_up
Recommended Articles
Page :