我希望使用Python对图像进行直接操作,因此想要使用ImageMagick的Python API绑定(http://wand-py.org)。然而,我无法从文档中推断出如何使用灰度转换。是否有人可以提供有关此问题的信息?
from wand.image import Image
try:
with Image(file=path) as img:
img.grayscale() # PSEUDOCODE for my given problem
except:
pass
我希望使用Python对图像进行直接操作,因此想要使用ImageMagick的Python API绑定(http://wand-py.org)。然而,我无法从文档中推断出如何使用灰度转换。是否有人可以提供有关此问题的信息?
from wand.image import Image
try:
with Image(file=path) as img:
img.grayscale() # PSEUDOCODE for my given problem
except:
pass