I would like to find a command that allows to combine two images (A.png and B.png) and generate a checkerboard superposition of the two (like you can see below https://i.stack.imgur.com/1kYTP.png).
Image A.png and B.png are 64x64. The content of these images can be completly different. The output image C.png should be composed of : top row first left tile: image A 8x8, top row second tile: image B 8x8, top row third tile image A 8x8, etc...
I have searched ImageMagick compose and convert quite a bit now without success. If anybody has any tip, that would be fantastic.
Thanks in advance, Chris.
Generate checkerboard superposition of two images
- GeeMack
- Posts: 718
- Joined: 2015-12-01T22:09:46-07:00
- Authentication code: 1151
- Location: Central Illinois, USA
Re: Generate checkerboard superposition of two images
It is always more helpful if you provide the version of ImageMagick you're using and let us know what platform or OS you're working on. (It's one of the rules described in THIS post at the top of the forum.) The exact commands and syntax may be very different from one version/OS/etc. to another. That said...
There are several ways to approach this. If your two input images are the same dimensions and orientation, you can create exactly the effect you describe using a command like this with IM6 from a Windows command line...
Code: Select all
convert input1.png input2.png -set option:distort:viewport "%[w]x%[h]" -filter point ^
( pattern:gray50 -scale 800% -virtual-pixel tile -distort SRT 0 ) -composite output.png
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Generate checkerboard superposition of two images
If on Unix-like system, you can try my script, interweave, at my link below. It is based on code similar to that of GeeMack above. But his is more concise.
Re: Generate checkerboard superposition of two images
@GeeMack yes sorry, should have said what OS (Ubuntu) and version (6.8.9-9) I am using. Thanks for your answers.
@fmw42 GREAT script, the interweave does exactly what I was looking for.
Very useful.
Christopher
@fmw42 GREAT script, the interweave does exactly what I was looking for.
Very useful.
Christopher