$image1 = new \Imagick('image8.png');
$opacity = new \Imagick();
$opacity->newPseudoImage($image1->getImageWidth(), $image1->getImageHeight(), "gradient:");
$opacity->setImageFormat('png');
$opacity->rotateimage('black', 90);
$image2 = clone $image1;
$image2->compositeImage($opacity, \Imagick::COMPOSITE_COPYOPACITY, 0, 0);
$image1->compositeImage($image2, \Imagick::COMPOSITE_ATOP, 100, -50);
$image3 = clone $image2;
$image3->compositeImage($opacity, \Imagick::COMPOSITE_COPYOPACITY, 0, 0);
$image1->compositeImage($image3, \Imagick::COMPOSITE_ATOP, 200, -100);
header('Content-type: image/png');
echo $image1;