<?php
bool public ImagickDraw::line(
float $sx,
float $sy,
float $ex,
float $ey
);
?>
<?php
// Run multiple times
$str1img = 'img/results/11new ln.png';
$red = mt_rand(0, 100);
$green = mt_rand(0, 100);
$blue = mt_rand(0, 100);
$k = mt_rand(0, 100) /100;
$strokeColor1 = '#ff25f2';
$strokeColor2 = '#fff225';
$strokeColor3 = 'cyan';
$fillColor = "rgb($red,$green,$blue)";
$backgroundColor = "cmyk($red,$green,$blue,$k)";
$draw = new ImagickDraw();
$draw->setStrokeColor($strokeColor1);
$draw->setFillColor($fillColor);
$draw->setStrokeWidth(2);
$draw->line(125, 70, 100, 50);
$draw->line(250, 170, 100, 150);
$draw->line(16, 16, 180, 16);
$draw->setStrokeColor($strokeColor2);
$draw->setStrokeWidth(6);
$draw->line(18, 260, 260, 260);
$draw->setStrokeColor($strokeColor3);
$draw->setStrokeWidth(50);
$draw->line(19, 22, 16, 250);
$imagick = new Imagick();
$imagick->newImage(300, 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; ?>">