Page 1 of 1
dst_in and black/white stripes to make sliced images?
Posted: 2010-05-11T18:54:07-07:00
by danpaluska
i made some stripes with this command:
convert -size 1x100 pattern:gray50 -scale 640x480\! stripesHORZ.gif
composite -compose Dst_In -gravity center stripesHORZ.gif image2.jpg temp1.png
composite -compose Dst_Out -gravity center stripesHORZ.gif image2.jpg temp2.png
convert temp1.png temp2.png -compose Plus -composite sliced.jpg
i want to take two images and make them into a single image by selecting alternate stripes.
i tried this but it doesn't work. i'm assuming the problem is that my stripes are white and black and one of the stripes should be clear instead of black or white.
any tips?
thanks,
dan
Re: dst_in and black/white stripes to make sliced images?
Posted: 2010-05-11T19:11:57-07:00
by danpaluska
i meant
composite -compose Dst_In -gravity center stripesHORZ.gif image1.jpg temp1.png
composite -compose Dst_Out -gravity center stripesHORZ.gif image2.jpg temp2.png
so not a typo problem as far as i know...
Re: dst_in and black/white stripes to make sliced images?
Posted: 2010-05-11T19:12:30-07:00
by fmw42
to exaggerate
convert -size 1x8 pattern:gray50 -scale 128x128\! -auto-level stripes.gif
convert zelda3.jpg mandril.jpg stripes.gif -compose over -composite zelda_mandril.jpg
see use of mask image at
http://www.imagemagick.org/Usage/compose/
Re: dst_in and black/white stripes to make sliced images?
Posted: 2010-05-11T20:35:00-07:00
by danpaluska
cool.
thanks!
i still don't quite understand all the subtleties as the examples in the usage seem to be for the composite command with 2 input images rather than the convert command with 3 input images. but it works great for me now!
and i'm assuming more will make itself clear to me in time.
Re: dst_in and black/white stripes to make sliced images?
Posted: 2010-05-11T20:40:11-07:00
by fmw42
danpaluska wrote:cool.
thanks!
i still don't quite understand all the subtleties as the examples in the usage seem to be for the composite command with 2 input images rather than the convert command with 3 input images. but it works great for me now!
and i'm assuming more will make itself clear to me in time.
you can use composite rather than convert by reversing the two input images. The mask is binary and simply selected corresponding area to the white part of one image and the corresponding part to the dark part of the other image and merges them together by making the alternate transparent. White in the mask defines opaque for one image and transparent for the other and black is reversed for the two images.
convert is more modern and flexible than composite, so I tend to use it more as you can do multiple steps in one command where you must separate commands when you use composite.