Page 1 of 1
overlay image on transparent canvas ImageMagick-5.4.3.11-1
Posted: 2013-05-18T13:03:14-07:00
by hav
I'm using an older version of ImageMagick and I'm sure it makes me sound incompetent but how do I overlay one image on another where one is just a transparent png to force specific dimensions for the final image? Many of the documented examples use options which are not, apparently, available in this older version of IM.
I've tried convert -coalesce and composite etc. but I always end up with a background color in what should be transparent space. ... I'm overlaying a jpg on a blank transparent png, if that manes a difference.
Thanks
Re: overlay image on transparent canvas ImageMagick-5.4.3.11
Posted: 2013-05-18T13:39:57-07:00
by snibgo
I don't have a version that old, but this might work:
Code: Select all
convert large.png small.jpg -composite out.png
If you output to a format that doesn't support transparency, like jpg, you will lose the transparency.
Re: overlay image on transparent canvas ImageMagick-5.4.3.11
Posted: 2013-05-18T14:15:14-07:00
by fmw42
that old IM version would probably need the composite command and not convert. you would be well of if you can upgrade (that version is about 1400 versions old)
composite -compose over small large_transparent result
see
http://www.imagemagick.org/Usage/basics/#cmdline
http://www.imagemagick.org/Usage/layers/#composite
http://www.imagemagick.org/Usage/compose/#compose
Re: overlay image on transparent canvas ImageMagick-5.4.3.11
Posted: 2013-05-18T18:39:28-07:00
by hav
Thanks guys - yes - composite -compose ... worked well - ... actually, it turns out, so did convert -coalesce large-transparent small-overlay -flatten output - I had just viewed the result with the browser directly but, in a rendered page, it was fine - sorry
yes - I'm not completely sure why the admin chose the old version to install?? something about an old server... I'll look into it more.
Thanks again!
Re: overlay image on transparent canvas ImageMagick-5.4.3.11
Posted: 2013-05-20T00:02:48-07:00
by anthony
If the image you are overlaying on is transparent why not do this..
Code: Select all
convert layer_image.png -background none -extent WIDTHxHEIGHT+X+Y enalrged_canvas_image.png