次の Wand に相当するものを書きたいと思います。
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')