I am attempting to put two images together.
One goes on the bottom. It has no effects.
The second goes ontop. It should have the effect of multiply.
But when I put these images together like so
header('Content-Type: image/png');
//Top image
$multiply = new Imagick();
$multiply->readImage("https://i.imgur.com/EZVN4Ws.png");
//Bottom image
$clipinto = new Imagick();
$clipinto->readImage("https://i.imgur.com/5XZqE7T.png");
//
//The two commented out did not solve the problem.
//$multiply->compositeImage($clipinto, Imagick::COMPOSITE_COPYOPACITY, 0, 0);
//$multiply->compositeImage($clipinto, Imagick::COMPOSITE_DSTIN, 0, 0, Imagick::CHANNEL_ALPHA);
//
//Multiply the top image into the buttom image
$clipinto->compositeImage($multiply, Imagick::COMPOSITE_MULTIPLY, 0, 0);
//See image
echo $clipinto;
I get an effect that is not intended, and in fact looks like how this image would look if it was not clipped together in photoshop. See the left image below.
What is the correct way to get the effect seen on the right? I had attempted
COMPOSITE_COPYOPACITY
and COMPOSITE_DSTIN
But these seem to worsen the issue, or give me the same effect. I would prefer if this could be done with other styles, such as OVERLAY as well as this clipping issue affects all layer styles.