array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'uk', ), 'this' => array ( 0 => 'imagick.blackthresholdimage.php', 1 => 'Imagick::blackThresholdImage', 2 => 'Forces all pixels below the threshold into black', ), 'up' => array ( 0 => 'class.imagick.php', 1 => 'Imagick', ), 'prev' => array ( 0 => 'imagick.averageimages.php', 1 => 'Imagick::averageImages', ), 'next' => array ( 0 => 'imagick.blueshiftimage.php', 1 => 'Imagick::blueShiftImage', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'en', 'path' => 'reference/imagick/imagick/blackthresholdimage.xml', ), 'history' => array ( ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); contributors($setup); ?>
(PECL imagick 2, PECL imagick 3)
Imagick::blackThresholdImage — Forces all pixels below the threshold into black
Is like Imagick::thresholdImage() but forces all pixels below the threshold into black while leaving all pixels above the threshold unchanged.
threshold
The threshold below which everything turns black
Повертає true
в разі успіху.
Версія | Опис |
---|---|
PECL imagick 2.1.0 | Now allows a string representing the color as a parameter. Previous versions allow only an ImagickPixel object. |
Приклад #1 Imagick::blackThresholdImage()
<?php
function blackThresholdImage($imagePath, $thresholdColor) {
$imagick = new \Imagick(realpath($imagePath));
$imagick->blackthresholdimage($thresholdColor);
header("Content-Type: image/jpg");
echo $imagick->getImageBlob();
}
?>