Colouring multiple images then layering with varying opacity
Posted: 2013-01-08T06:09:46-07:00
Hi,
Only just started using imagaemajick so a newbie I'm afraid.
I'm trying to accomplish the following:
Choose a small selection of images [will be three in the following example]
Background - dots.png
Overlay circle.png - colorize red and make opacity 50%
Flatten image and save as PNG [rendered.png]
So here's my code in PHP:
<?php
$tempfile1 = ROOT . '/PUBLIC/_images/flexlayers/dots.png';
$tempfile2 = ROOT . '/PUBLIC/_images/flexlayers/star.png';
$output = ROOT . '/PUBLIC/_images/flexlayers/rendered.png';
exec('convert.exe "'.$tempfile1.'" +level-colors #FF0000, ("'.$tempfile2 .'" +level-colors #0000FF, -alpha on -channel a -evaluate set 25%) -composite "'.$output.'"');
?>
I'm halfway there but the following is happening in rendered.png
* dots.png is being coloured red
* star.png is being coloured blue BUT dots.png is also being coloured blue resulting in purple
* the 25% opcaity is being applied to both layers, not just star.png
Can anyone adivse on how I make the operations apply only to a specific layer - do I need to perform multiple saves and reload each time?
Kind Regards
JB
Only just started using imagaemajick so a newbie I'm afraid.
I'm trying to accomplish the following:
Choose a small selection of images [will be three in the following example]
Background - dots.png
Overlay circle.png - colorize red and make opacity 50%
Flatten image and save as PNG [rendered.png]
So here's my code in PHP:
<?php
$tempfile1 = ROOT . '/PUBLIC/_images/flexlayers/dots.png';
$tempfile2 = ROOT . '/PUBLIC/_images/flexlayers/star.png';
$output = ROOT . '/PUBLIC/_images/flexlayers/rendered.png';
exec('convert.exe "'.$tempfile1.'" +level-colors #FF0000, ("'.$tempfile2 .'" +level-colors #0000FF, -alpha on -channel a -evaluate set 25%) -composite "'.$output.'"');
?>
I'm halfway there but the following is happening in rendered.png
* dots.png is being coloured red
* star.png is being coloured blue BUT dots.png is also being coloured blue resulting in purple
* the 25% opcaity is being applied to both layers, not just star.png
Can anyone adivse on how I make the operations apply only to a specific layer - do I need to perform multiple saves and reload each time?
Kind Regards
JB