Hi,
I've searching and I found this viewtopic.php?t=18842, but the image is gone, so please answer this again
Got 3 image below, layer1.png, layer2.png and result.png repsectively.
How could I produce the result (it is layer2 over layer1, but I got stuck at the end, when cutting the transparency).
Important note: the layer 1 could be white as well.
Many thanks
Help me with composite and Inverse transparency
-
- Posts: 3
- Joined: 2015-05-27T14:28:09-07:00
- Authentication code: 6789
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Help me with composite and Inverse transparency
The image you uploaded or is being downloaded is in JPG format and has lost any transparency from the PNG original.
If you have the png original where the gray in layer 2 is transparent, then this is one way. There may be other more efficient methods.
The above is unix syntax. For windows do
If you have the png original where the gray in layer 2 is transparent, then this is one way. There may be other more efficient methods.
Code: Select all
convert layer1.png \( layer2.png -alpha extract -negate \) -compose copy_opacity -composite layer3.png
Code: Select all
convert layer1.png ( layer2.png -alpha extract -negate ) -compose copy_opacity -composite layer3.png
-
- Posts: 3
- Joined: 2015-05-27T14:28:09-07:00
- Authentication code: 6789
Re: Help me with composite and Inverse transparency
Thanks you very much , one more question, how this can be achive in php ?fmw42 wrote:The image you uploaded or is being downloaded is in JPG format and has lost any transparency from the PNG original.
If you have the png original where the gray in layer 2 is transparent, then this is one way. There may be other more efficient methods.
...
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Help me with composite and Inverse transparency
Just use the exec() function to enclose the same command.one more question, how this can be achive in php ?
Code: Select all
<?php
exec("convert layer1.png \( layer2.png -alpha extract -negate \) -compose copy_opacity -composite layer3.png 2>&1",$out,$returnval);
foreach($out as $text)
{echo "$text<br>";}
?>