<?php
bool public Imagick::blackThresholdImage(mixed $threshold);
?>
<?php
// Run several times
$path1 = PATH2IMGW . '/jpg/3.jpg';
$str1img = 'img/results/3bth671.gif';
$im1 = new Imagick($path1);
$r = mt_rand(16, 255);
$g = mt_rand(16, 255);
$b = mt_rand(16, 255);
$rr = dechex($r);
$gg = dechex($g);
$bb = dechex($b);
$thresholdColor = '#'. "$rr$gg$bb";
$im1->blackthresholdimage($thresholdColor);
$image1 = $im1->getImageBlob();
$img = imagecreatefromstring($image1);
imagegif($img, $str1img);
echo basename($str1img); ?>
<br><br>
<img src="<?php echo $str1img; ?>"
alt="<?php echo $str1img; ?>"
title="<?php echo $str1img; ?>">