<?php
$imagick
=
new
Imagick();
$imagick
->newImage(800, 250,
'white'
);
$draw
=
new
ImagickDraw();
$draw
->setStrokeColor(
'red'
);
$draw
->setFillColor(
'purple'
);
$draw
->setStrokeWidth(2);
$draw
->setFontSize(72);
$draw
->pushDefs();
$draw
->setStrokeColor(
'green'
);
$draw
->rectangle(150, 50, 300, 200);
$draw
->popDefs();
$draw
->rectangle(400, 50, 550, 200);
$imagick
->drawImage(
$draw
);
$imagick
->setImageFormat(
'png'
);
header(
"Content-Type: image/png"
);
echo
$imagick
->getImageBlob();
?>