2013-04-22 88 views
7

我想使用Python API綁定ImageMagick http://wand-py.org直接操作圖像。但是,我無法從文檔中推斷出如何使用灰度轉換。任何人都可以提供有關此問題的信息嗎?使用python魔杖來灰度圖像

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

回答