Example
function mergeImageLayers($layerMethod)
{
//$imagick = new \Imagick(realpath("images/LayerTest.psd"));
//$imagick = new \Imagick(realpath("../public/images/Biter_500.jpg"));
$imagick = new \Imagick(realpath("../public/images/redDiscAlpha.png"));
//
// $imagick = new \Imagick();
$blueDisc = new \Imagick(realpath("../public/images/blueDiscAlpha.png"));
$imagick->addImage($blueDisc);
//
// $imagick->addImage($whiteDisc);
$greenDisc = new \Imagick(realpath("../public/images/greenDiscAlpha.png"));
$imagick->addImage($greenDisc);
$imagick->setImageFormat('png');
$result = $imagick->mergeImageLayers($layerMethod);
header("Content-Type: image/png");
echo $result->getImageBlob();
}