Page 1 of 1

How to blend 3 pictures together, alternating 10px blocks

Posted: 2012-10-30T06:39:42-07:00
by Ornux
Hello,

I'm almost new to ImageMagick, trying to use it to blend 3 pictures in a specific way. Let's call them pictures 1, 2 and 3.
The 3 pictures have the exact same resolution.

I'd like to combine them into a single picture alternating 10 (or 5, or 25, whatever) pixels blocks of each one.

The result would be a picture with the same resolution as my input pictures, and would be something like :

Code: Select all

  [1][2][3][1][2][3]
  [2][3][1][2][3][1]
  [3][1][2][3][1][2]
  [1][2][3][1][2][3]
  [2][3][1][2][3][1]
  [3][1][2][3][1][2]
After some investigation, I found that "special compose" might be a way, but I'm not sure how to proceed.


Thanks for any recommendation you have!
~Ornux

Re: How to blend 3 pictures together, alternating 10px block

Posted: 2012-10-30T10:43:21-07:00
by fmw42
My script, interweave, at the link below will do that but only for two images at this time.

Re: How to blend 3 pictures together, alternating 10px block

Posted: 2012-10-31T01:33:49-07:00
by Ornux
Thank you so much ! :D

Now that I know how to proceed for two images, I will be able to change it so that it works with 3.
Nice scripts database, btw.

Re: How to blend 3 pictures together, alternating 10px block

Posted: 2012-10-31T10:53:39-07:00
by fmw42
Ornux wrote:Thank you so much ! :D

Now that I know how to proceed for two images, I will be able to change it so that it works with 3.
Nice scripts database, btw.
You will have to do them two at a time as I don't think masking in -composite works with more than two image. I would do it separately in the X and Y directions. Composite two image with a vertical band mask, shift the mask or recreate it for the third image, then composite that -- all for the X direction. Then repeat with a horizontal band mask.

Might I ask what the purpose is of this result?

Fred

Re: How to blend 3 pictures together, alternating 10px block

Posted: 2012-11-05T02:50:07-07:00
by Ornux
You will have to do them two at a time as I don't think masking in -composite works with more than two image. [...]
The third image wasn't necessary, so I limited my selection to two and used your script.
Might I ask what the purpose is of this result?
I have several maps with graphical representation (mostly color gradient) of different sets of data. I wanted to be able to gather them in a single one, but a "regular" fusion was unusable.

Re: How to blend 3 pictures together, alternating 10px block

Posted: 2012-12-13T18:21:09-07:00
by anthony
There is one other solution. Using a map to select a image index. This uses FX but it does work...
http://www.imagemagick.org/Usage/quantize/#diy_symbols

Yes it uses a tiled lookup of small images, but the images can be of ANY size, including the full size.

If this proves popular, it might even be added as a faster operation of some kind.


If you do use multiple composes, a simple way is to use compostions make appropriate transparent windows in the first two images, then layer the images together (assuming the original images has no transparency).