【发布时间】:2013-09-27 03:08:59
【问题描述】:
我正在尝试使用 Python Wand 实现以下 ImageMagick 命令:
convert red_image.png green_image.png write_mask.png -composite masked_composite.png
这是它在图像中的示例:
有什么提示吗?
更新:如果有人想知道,这是我的解决方案。注意:不优雅,但有效。
bash_command = "convert "+str(red_image.png)+" "+str(green_image.png)+" write_mask.png - composite "+str(red_image.png)+str(green_image.png)+".jpg"
os.system(bash_command)
【问题讨论】:
-
将蒙版放入绿色图像的 alpha 通道,然后与红色图像合成,这样您就只有两个图像要合成。然后你应该能够在 Wand 中做到这一点。您甚至可以将蒙版放入 Wand 中的 Alpha 通道。
标签: python imagemagick wand