Hello,
i'm searching for an easy way to merge two PNG images with transparency overlapping.
The end result should look like this:
For the output image i need the size 500x750 as a png with transparency.
a.png should be resized to 60% of the output image (or a fixed size) and placed in the bottom left corner.
b.png should be resized to 60% of the output image (or a fixed size) and placed in the top right order (behind a.png)
Both images also have transparency.
Thanks
Dieter
Merge two PNG images overlapping
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: Merge two PNG images overlapping
What version of IM? I'll assume v6.
What interface? I'll assume the command line.
What platform? I'll assume Windows.
You want to composite a.png over b.png, with both images offset. There are many ways to do this. Here, I create a 500x750 transparent image, composite b.png over it in the NorthEast corner, then a.png at the SouthWest corner.
What interface? I'll assume the command line.
What platform? I'll assume Windows.
You want to composite a.png over b.png, with both images offset. There are many ways to do this. Here, I create a 500x750 transparent image, composite b.png over it in the NorthEast corner, then a.png at the SouthWest corner.
Code: Select all
convert ^
-size 500x750 xc:None ^
-background None ^
( b.png -resize 300x450 ) -gravity NorthEast -composite ^
( a.png -resize 300x450 ) -gravity SouthWest -composite ^
out.png
snibgo's IM pages: im.snibgo.com
Re: Merge two PNG images overlapping
Exactly what I was looking for!
Thank you, works perfectly.
Thank you, works perfectly.