(Информация о версии неизвестна, возможно, только в SVN)
Imagick::floodFillPaintImage — Changes the color value of any pixel that matches target
$fill
, float $fuzz
, mixed $target
, int $x
, int $y
, bool $invert
[, int $channel = Imagick::CHANNEL_DEFAULT
] )Changes the color value of any pixel that matches target and is an immediate neighbor. This method is a replacement for deprecated Imagick::paintFloodFillImage(). Этот метод доступен, если Imagick был скомпилирован с версией ImageMagick 6.3.8 или старше.
fillImagickPixel object or a string containing the fill color
fuzzМера округления (fuzz). Для примера, установите значение fuzz в 10 и красный цвет с интенсивностью 100 и 102 будет интерпретироваться как один и тот же цвет.
targetImagickPixel object or a string containing the target color to paint
xX start position of the floodfill
yY start position of the floodfill
invert
If TRUE paints any pixel that does not match the target color.
channel
Передайте любую корректную для вашего режима канала константу.
Для применения к более чем одному каналу, комбинируйте константы каналов
с помощью побитовых операторов. По умолчанию равно Imagick::CHANNEL_DEFAULT.
Обратитесь к списку констант каналов
В случае успешной работы возвращает TRUE.
Пример #1 Imagick::floodfillPaintImage() example
<?php
/* Create new imagick object */
$im = new Imagick();
/* create red, green and blue images */
$im->newImage(100, 50, "red");
$im->newImage(100, 50, "green");
$im->newImage(100, 50, "blue");
/* Append the images into one */
$im->resetIterator();
$combined = $im->appendImages(true);
/* Save the intermediate image for comparison */
$combined->writeImage("floodfillpaint_intermediate.png");
/* The target pixel to paint */
$x = 1;
$y = 1;
/* Get the color we are painting */
$target = $combined->getImagePixelColor($x, $y);
/* Paints pixel in position 1,1 black and all neighboring
pixels that match the target color */
$combined->floodfillPaintImage("black", 1, $target, $x, $y, false);
/* Save the result */
$combined->writeImage("floodfillpaint_result.png");
?>
Результатом выполнения данного примера будет что-то подобное: