Search code examples
imagemagickimagemagick-convert

Imagemagick command geometry not working


I am having image1.jpg with the size of 350x500 and another image2.png ( 350x150 ) with gradient effects like shadow. I need to apply the shadow to image1.jpg in its bottom. But geometry doesn't work for me.

convert -extent 600x700\! image1.jpg \( image2.png -geometry +0+500 \) -composite final.png

I hope the geometry will position an image at the point I have given, If I am right, geometry is not working for me.


Solution

  • Not certain what you are trying to achieve, but is this close:

    convert xc:red[350x500] -extent 600x700\! xc:blue[350x150] -geometry +80+300 -composite result.png
    

    enter image description here

    Maybe you have some left-over paging info in your PNG file, you can remove it by adding +repage immediately after loading it:

    convert ... ... image.png +repage ...
    

    You can identify it like this:

    enter image description here