Search code examples
mergeimagemagickmaskimagick

Imagemagick to merge and mask images


I recently started working with Imagemagick and I had a problem that needs to be solved.

I have such a thumbnail.

thumbnail

And there is such a mask.

cloud-mask

I need to get this image on the output.

complete

I looked through this link http://www.imagemagick.org/Usage/thumbnails/ I tried everything there, but I did not get success ((

I hope you will help me.


Solution

  • This should give you a result very much like your example...

    convert mask.png image.png -gravity north -composite \
          mask.png -compose copyopacity -composite result.png
    

    You can adjust the positioning of the overlay by including something like "-geometry -10+0" before the first composite.

    To use this command in Windows you'll need to change that continued line backslash "\" to a caret "^".