Imagick::charcoalImage


wizard apg

SIMULATES the charcoal drawing of an image.



<?php

bool 
public Imagick::charcoalImage(
                                           
float $radius, 
                                           
float $sigma
                                                  
);
                               
?>

$radius


The radius of the Gaussian, in pixels, not counting the center pixel.



$sigma


The standard deviation of the Gaussian, in pixels.





This function returns true on success.



  1 EXERCISE   

<?php

$path 
= PATH2IMGW . '/others/IMG_10703a.png'; 

$str1img = 'img/results/IMG_10703aci.jpg';    

$radius = mt_rand(0, 10);

$sigma = mt_rand(0, 100);

$imagick = new Imagick($path);

$imagick->charcoalImage($radius, $sigma);

$magick = $imagick->getImageBlob();

$img = imagecreatefromstring($imagick);

imagejpeg($img, $str1img);

echo 
basename($str1img) ; ?>
<br><br>
<img src="<?php echo $str1img; ?>"
 alt="<?php echo $str1img; ?>" 
 title="<?php echo $str1img; ?>">

 RESULT   


IMG_10703aci.jpg

radius = 2
sigma = 52

img/results/IMG_10703aci.jpg apr