PHP 8.3.4 Released!

Imagick::whiteThresholdImage

(PECL imagick 2, PECL imagick 3)

Imagick::whiteThresholdImageFuerza a todos los píxeles por encima del umbral a ser blancos

Descripción

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

Es como Imagick::ThresholdImage() excepto que fuerza a todos los píxeles por encima del umbral a ser blancos dejando todos los píxeles por debajo del umbral sin cambios.

Parámetros

threshold

Valores devueltos

Devuelve true en caso de éxito.

Historial de cambios

Versión Descripción
ECL imagick 2.1.0 Ahora se permite que una cadena represente el color como parámetro. Versiones previas sólo permitían un objeto ImagickPixel.

Ejemplos

Ejemplo #1 Imagick::whiteThresholdImage()

<?php
function whiteThresholdImage($imagePath, $color) {
$imagick = new \Imagick(realpath($imagePath));
$imagick->whiteThresholdImage($color);
header("Content-Type: image/jpg");
echo
$imagick->getImageBlob();
}

?>

add a note

User Contributed Notes 1 note

up
0
elmer at web-axis dot net
15 years ago
Here's a example of this function:

<?php
$img
= new Imagick();
$img->readImage($image_file_name);
$img->whiteThresholdImage('grey');
$img->writeImage($thumb_file_name);
$img->clear();
$img->destroy();
?>
To Top