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); ?>

Imagick::blackThresholdImage

(PECL imagick 2, PECL imagick 3)

Imagick::blackThresholdImageForces all pixels below the threshold into black

Опис

public Imagick::blackThresholdImage(mixed $threshold): bool

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();
}

?>