0
的,我想写出魔杖相当于:棒相当于复合-stereo
composite -stereo 0 right.tif left.tif output.tif
我认为0是x轴偏移和可能是不相关的。我已经把其他帖子中的一些小部分联系在一起,结果很好,但是有点冗长。这是可以做到的最好的吗?
#! /usr/bin/python
from wand.image import Image
from wand.color import Color
# overlay left image with red
with Image(filename='picture1.tif') as image:
with Image(background=Color('red'), width=image.width, height=image.height) as screen:
image.composite_channel(channel='all_channels', image=screen, operator='multiply')
image.save(filename='picture1red.tif')
# overlay right image with cyan
with Image(filename='picture2.tif') as image:
with Image(background=Color('cyan'), width=image.width, height=image.height) as screen:
image.composite_channel(channel='all_channels', image=screen, operator='multiply')
image.save(filename='picture2cyan.tif')
# overlay left and right images
with Image(filename='picture1red.tif') as image:
with Image(filename='picture2cyan.tif') as screen:
image.composite_channel(channel='all_channels', image=screen, operator='add')
image.save(filename='3Dpicture.tif')
最后的')'需要删除。我认为这一定是可能的,谢谢!你的代码比我的更冷静,它可以让我不用担心管理我创建的中间文件。 – ChrisOfBristol 2015-04-19 18:59:02