user8915316
user8915316

Reputation: 13

ImageMagick and alpha channel CMD

I'm trying to create the image with Alpha channel from the second image. I have used this cmd command on windows:

magick composite Background.tif  Alpha.tif -compose multiply -alpha on Result.tif

This command creates combined tif, but alpha channel is empty.

Would you be able to provide me with any help?

Thank you very much.

enter image description here

Inputs:

Background.tif enter image description here

Foreground.tif enter image description here

Output:

Result - Background+ForegroundAlpha100.tif enter image description here

Edit: I have a two commands which do I can. Is possible merge this commands into one command? First create some inputs:

magick -size 640x480 xc:black 100.png 
magick logo: logo.png 

And this are the two commands I need merge:

magick convert 100.png -alpha on -channel A -evaluate set 50% +channel tmp1.png 
magick logo.png tmp1.png -compose copy-alpha -composite alpha50.png

Upvotes: 1

Views: 330

Answers (1)

Mark Setchell
Mark Setchell

Reputation: 207445

Make a sample alpha channel:

magick -size 180x80 gradient: -bordercolor white -border 10 alpha.png

enter image description here

Make a sample background of solid red:

magick -size 200x100 xc:red background.png

enter image description here

Add alpha channel to solid red background:

magick background.png alpha.png -compose copy-alpha -composite result.png

enter image description here

Upvotes: 1

Related Questions