Opacity masking an image
Posted: 2009-04-25T01:31:04-07:00
Hello
For a Magic: The Gathering TCG card maker, I'm using Imagemagick from commandline within PHP. I'm now trying to use a mask on the illustration uploaded by the user.
Illustration :

Mask 2:

(mask 1 is the same except the black is transparant)
I've tried many things ($place is the uploaded illustration)
Which one is right? What do I have to do?
For a Magic: The Gathering TCG card maker, I'm using Imagemagick from commandline within PHP. I'm now trying to use a mask on the illustration uploaded by the user.
Illustration :

Mask 2:

(mask 1 is the same except the black is transparant)
I've tried many things ($place is the uploaded illustration)
Code: Select all
"composite ".$place." images/mask2.png -alpha Off -compose Copy_Opacity ".$place
Code: Select all
"convert ".$place." images/mask1.png -compose DstIn -composite ".$place
Code: Select all
"composite ".$place." ".$place." images/mask1.png ".$place
Code: Select all
"convert ".$place." -mask images/mask1.png ".$place