Can I access ImageMagick API with Python?

前端 未结 3 2082
你的背包
你的背包 2020-11-29 23:17

I need to use ImageMagick as PIL does not have the amount of image functionality available that I am looking for. However, I am wanting to use Python.

The python bin

3条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-11-29 23:32

    This has worked for me for the following command to create an image from text for the letter "P":

    import subprocess
    
    cmd = '/usr/local/bin/convert -size 30x40 xc:white -fill white -fill black -font Arial -pointsize 40 -gravity South -draw "text 0,0 \'P\'" /Users/fred/desktop/draw_text2.gif'
    
    subprocess.call(cmd, shell=True)
    

提交回复
热议问题