Page 1 of 1

How can I interlace two images

Posted: 2016-04-01T05:25:18-07:00
by ffleader1
So i have two image of the same size. I want to combine them by taking the odd lines from the first image, the even lines from the second image, and put them together.
How should I do it?
(Using ImageMaick on Command Prompt for Windows)

Re: How can I interlace two images

Posted: 2016-04-01T06:10:27-07:00
by snibgo
I would "-composite" with a mask that has alternating black and white lines.

Re: How can I interlace two images

Posted: 2016-04-01T10:56:46-07:00
by fmw42
For unix (Linux, Max OSX or Window w/Cygwiin) see my script interweave at the link below:

Code: Select all

interweave -m row -b 1 zelda3.jpg peppers2.jpg result.png

Re: How can I interlace two images

Posted: 2016-04-01T11:01:02-07:00
by ffleader1
I got the solution. Thanks for those who helped :D

Re: How can I interlace two images

Posted: 2016-04-01T11:12:59-07:00
by fmw42
Assuming your images are the same size, then make a one row black image and a one row white image (the same width as your images) and append them vertically (-append). Then tile that out to the height of your two images (-tile or tile:). Then use the result as a mask image to composite (-compose over ... -composite) the two input images together.