I have three PNGs that I want merged at different positions on a transparent canvas with a fixed size.
Let's say the canvas is 200x200, the images all about 50x50 and I want the first at 25x 125y, the second at 75x 125y and the third at 125x 125y. How would I go about this?
Example:
Merge three images at different positions on a transparent canvas
-
- Posts: 3
- Joined: 2015-09-21T08:25:56-07:00
- Authentication code: 1151
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: Merge three images at different positions on a transparent canvas
You might use "-layers" with a page setting, or "-composite" with a geometry.
snibgo's IM pages: im.snibgo.com
-
- Posts: 3
- Joined: 2015-09-21T08:25:56-07:00
- Authentication code: 1151
Re: Merge three images at different positions on a transparent canvas
I couldn't get the canvas to be transparent. It always turns out black.snibgo wrote:You might use "-layers" with a page setting, or "-composite" with a geometry.
Code: Select all
convert --size200x200 xc:none output.png -composite 1.png -composite 2.png -composite 3.png
Re: Merge three images at different positions on a transparent canvas
You will need -background none. And output file should be placed last of the command sequence.276QeqxYSCrFENSx wrote: I couldn't get the canvas to be transparent. It always turns out black.
Code: Select all
convert xc:none[200x200\!] -background none \( rose: -resize 50x50\! -geometry +25+125 \) -compose over -composite \( rose: -resize 50x50\! -geometry +75+125 \) -compose over -composite \( rose: -resize 50x50\! -geometry +125+125 \) -compose over -composite show:
Code: Select all
convert xc:none[200x200\!] -background none \( rose: -resize 50x50\! -repage +25+125 \) \( rose: -resize 50x50\! -repage +75+125 \) \( rose: -resize 50x50\! -repage +125+125 \) -layers merge show:
-
- Posts: 3
- Joined: 2015-09-21T08:25:56-07:00
- Authentication code: 1151
Re: Merge three images at different positions on a transparent canvas
Thanks 246246, the first command is what I was looking for. It works with "gravity" and solves the problem.