I'm using ImageMagick's composite command to compose one smaller image over larger one. The resulting image should be of size of the background image (the larger one). Additionally I want the smaller one to be always of the same size.
Currently I have such a simple invocation:
composite -gravity SouthWest watermark.png photo.jpg photo.jpg
The problem is that I get different sizes of watermark for different photos and I don't know how to set it to be fixed size. I tried -resize, -geometry and -size options but all of them change size of resulting image and not the watermark.
I had a similar problem and tried all sorts of different options with the composite command to try to get it to work. Eventually I had to switch to using the convert command and was able to get it to resize with gravity using:
convert photo.jpg -gravity SouthWest -draw "image Over 0,0,200,200 watermark.png" photo.jpg
The numeric parameters for -draw are left,top,width,height. See http://www.imagemagick.org/script/command-line-options.php?#draw. So this solution no longer uses the composite command but hopefully gives you what you want.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With