S
S
shkolin2020-08-28 19:42:14
PHP
shkolin, 2020-08-28 19:42:14

How to implement the doubling effect?

Desired result after processing

007S8ZIlgy1gi6zwj099ij30u00u07wi.jpg

My result

$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;


007S8ZIlgy1gi6ztvomcjj30u00u01kz.jpg

Answer the question

In order to leave comments, you need to log in

1 answer(s)
N
Ninazu, 2020-08-29
@Ninazu

Judging by what you need, you need to do three things with the copied pictures
1. Set them to a different level of transparency (from lower to higher)
2. Apply blur (in the same way as with transparency)
3. Cut diagonally and shift the triangles

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question