<?php
bool public ImagickDraw::circle(
float $ox,
float $oy,
float $px,
float $py
);
?>
<?php
// Run multiple time
$str1img = 'img/results/12new cr.png';
$red = mt_rand(0, 100);
$green = mt_rand(0, 100);
$blue = mt_rand(0, 100);
$k = mt_rand(0, 100) /100;
$c = [ 'cyan', 'red', 'green', 'blue'];
$n = mt_rand(0,3);
$strokeColor = "rgb($red,$green,$blue)";
$fillColor = $c[$n];
$backgroundColor = "cmyk($red,$green,$blue,$k)";
$originX = 180;
$originY = 180;
$endX = 250;
$endY = 250;
$draw = new ImagickDraw();
$strokeColor = new ImagickPixel($strokeColor);
$fillColor = new ImagickPixel($fillColor);
$draw->setStrokeOpacity(1);
$draw->setStrokeColor($strokeColor);
$draw->setFillColor($fillColor);
$draw->setStrokeWidth(2);
$draw->circle($originX, $originY, $endX, $endY);
$imagick = new Imagick();
$imagick->newImage(400, 300, $backgroundColor);
$imagick->setImageFormat("png");
$imagick->drawImage($draw);
$str=$imagick->getImageBlob();
$img = imagecreatefromstring($str);
imagepng($img, $str1img);
echo basename($str1img); ?>
<br><br>
<img src="<?php echo $str1img; ?>"
alt="<?php echo $str1img; ?>"
title="<?php echo $str1img; ?>">