Page 2 of 2

Re: Composite transparent layer and underlying layer

Posted: 2016-02-26T18:56:32-07:00
by fmw42
If we do that, it would distort either the background image or the frame image. If you want to do the frame image, then you can always distort it perfectly to match the background image.

try

Code: Select all

background="Ah4mtPw.jpg"
frame="mo9LQCx.gif"
size=`convert $background -format "%wx%h" info:`
convert $background \( $frame -resize $size! \) -gravity center -compose over -composite result.png

If the two images' aspect ratios are different, you will have to distort one or the other. There is no way to make them fit without distortion, unless you crop or pad as the code I provided earlier.

Re: Composite transparent layer and underlying layer

Posted: 2016-02-29T12:31:31-07:00
by buchert
Okay thanks for your help fmw42. I've decided to pad the images that are not wide enough with this command:

Code: Select all

convert aaa.jpg -bordercolor black -border 30x0 result.jpg