Page 1 of 1

Merging two image with transparency

Posted: 2018-06-13T11:34:57-07:00
by manpaint
ImageMagick version: ImageMagick-7.0.6-Q16)
Operating System: Windows 7 (64 bits)

Hi, I am trying since two hours now to merge two image that contain transparency (and have the same size) together, here's what I tried so far (as individual commands):

Code: Select all

convert bg.png  2.png -gravity center -composite result.png
convert bg.png bg2.png -gravity center -composite result.png
convert bg.png null: *.png -gravity center -layers composite result%03d.png
composite -geometry  +0+0 bg.png bg2.png result.png
-composite bg.png bg2.png -gravity center -composite result.png
convert bg.png bg2.png -flatten  result.png
composite bg.png bg2.png result.png
convert *bg.png *bg2.png -background none -flatten out.png
Here's what I'm trying to do (random exemple with an Rpg Maker charset; but you get the idea):
Image

I obviously put both images in the same folder and execute the command here but most of the time it just return the error 'bg2.png is not a valid parameters'. I used ImageMagick before to do simple image flipping via cmd and it worked just fine but now, everything I tried so far just dosen't work. Do anyone here have an idea of what is wrong/is the right commad to do)?

Re: Merging two image with transparency

Posted: 2018-06-13T11:50:08-07:00
by snibgo
ImageMagick does not make the error message "bg2.png is not a valid parameter". That error message comes from a Microsoft Windows program called convert.exe.

You can put your IM directory at the front of your system path, or always call convert with an explicit path, or rename it something like imconvert.exe.

Re: Merging two image with transparency

Posted: 2018-06-13T12:03:18-07:00
by manpaint
snibgo wrote:
2018-06-13T11:50:08-07:00
ImageMagick does not make the error message "bg2.png is not a valid parameter". That error message comes from a Microsoft Windows program called convet.exe.

You can put your IM directory at the front of your system path, or always call convert with an explicit path, or rename it something like imconvert.exe.
Thanks! It now works very well.