Use python wand for halftone

I want to use the Python API binding for ImageMagick http://wand-py.org for direct image management. However, I cannot deduce from the documentation how to use grayscale conversion. Can someone provide information on this issue?

from wand.image import Image try: with Image(file=path) as img: img.grayscale() # PSEUDOCODE for my given problem except: pass 
+7
source share
1 answer

This can be achieved by setting the color space of the image.

 from wand.image import Image with Image(filename='color.jpg') as img: img.type = 'grayscale'; img.save(filename='grayscale.jpg'); 

further reading:

+16
source

All Articles