update : 2015.11.03
php.shukuma.com

검색:
 
 
Changes the color value of any pixel that matches target

Imagick::floodFillPaintImage

(No version information available, might only be in Git)

Imagick::floodFillPaintImageChanges the color value of any pixel that matches target

설명

bool Imagick::floodFillPaintImage ( mixed $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 이상으로 컴파일 했을 때만 사용할 수 있습니다.

인수

fill

ImagickPixel object or a string containing the fill color

fuzz

fuzz 양. 예를 들면, fuzz를 10으로 설정했을 때 붉은색의 농도를 100과 102로 설정한 것은 같은 색으로 취급합니다.

target

ImagickPixel object or a string containing the target color to paint

x

X start position of the floodfill

y

Y start position of the floodfill

invert

If TRUE paints any pixel that does not match the target color.

channel

채널 모드에 유효한 채널 상수를 제공합니다. 둘 이상의 채널을 적용하려면, 비트 연산자를 이용해서 채널 상수를 조합하십시오. 기본값은 Imagick::CHANNEL_DEFAULT. 채널 상수 목록을 참고하십시오.

반환값

성공시에 TRUE를 반환합니다.

예제

Example #1 Imagick::floodfillPaintImage() example

<?php

/* Create new imagick object */
$im = new Imagick();

/* create red, green and blue images */
$im->newImage(10050"red");
$im->newImage(10050"green");
$im->newImage(10050"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$yfalse);

/* Save the result */
$combined->writeImage("floodfillpaint_result.png");
?>

위 예제의 출력 예시:

Output of example : Imagick::floodfillPaintImage()
Output of example : Imagick::floodfillPaintImage()