<?php
$colorMatrix
= [
1.5, 0.0, 0.0, 0.0, 0.0, -0.157,
0.0, 0.0, 0.5, 0.0, 0.0, -0.157,
0.0, 0.0, 0.0, 0.0, 0.5, -0.157,
0.0, 0.0, 0.0, 1.0, 0.0, 0.0,
0.0, 0.0, 0.0, 0.0, 1.0, 0.0,
0.0, 0.0, 0.0, 0.5, 0.0, 1.0
];
$imagick
=
new
\Imagick(
$imagick
->evaluateImage(
Imagick::EVALUATE_MULTIPLY,
0.6,
Imagick::CHANNEL_ALPHA
);
$background
=
new
\Imagick();
$background
->newPseudoImage(
$imagick
->getImageWidth(),
$imagick
->getImageHeight(),
"pattern:hexagons"
);
$background
->setImageFormat(
'png'
);
$imagick
->setImageFormat(
'png'
);
$imagick
->colorMatrixImage(
$colorMatrix
);
$background
->compositeImage(
$imagick
,
\Imagick::COMPOSITE_SRCATOP,
0,
0
);
header(
"Content-Type: image/png"
);
echo
$background
->getImageBlob();
?>