skip to Main Content

How can I blend AND translate at the same time ?

Something like this : but in such a way that the images are transparent.

I was trying :

composite -blend 90 -page +0+0 input01.jpg -page +500+0 input02.jpg  -resize x400 outputSimpleMosaicBlend01.

but this did not work.

So if I have two input images:
enter image description here
enter image description here

Then how can I get an image that looks like the composite image below ?

enter image description here

Any suggestions how to do this programatically (not manually) with ImageMagick ? Or some other tools ?

I would like to create several thousands of composite images like that (for an animation) and I would like to automate the process.

The problem is that I can find examples that overlay images and that translate images but I cannot find examples that do these two operations simultaneously.

This is the main goal of this question, to give such code/script examples, how to do that with image manipulation tools like ImageMagick programmatically.


Things that I tried and did not work:

convert a.jpg -geometry +100+0 b.jpg -compose blend -composite result.jpg


enter image description here

I tried

convert -background none a.jpg -geometry +100+0 b.jpg -compose blend -composite result.jpg

too which gives the same result.

I got this :
enter image description here

with this

convert -background none input01.jpg input02.jpg -geometry +1200+0 -compose blend -define compose:args=50 -composite result.jpg


It’s getting close ! Thanks Mark!



  1. Chosen as BEST ANSWER

    Thanks to Snigbo, the following command :

    convert input02.jpg  ( input01.jpg -resize 150% -alpha Opaque -channel A -evaluate Multiply 0.5 +channel -set page +1200+30 )  -background White -layers merge a.jpg


    enter image description here

  2. A slightly different way of doing this is to set the width of the output image using -extent and then to overlay the right hand image using -gravity East to align it to the right edge – seems a fraction more intuitive to me – but go with whatever works for you!

    convert a.jpg -background white -extent 2800x 
       ( b.jpg -resize 150% -alpha on -channel A -evaluate set 50% +channel ) 
       -gravity east -composite result.jpg

    enter image description here

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top