1--TEST-- 2Test Imagick, floodFillPaintImage 3--SKIPIF-- 4<?php 5$imageMagickRequiredVersion=0x675; 6require_once(dirname(__FILE__) . '/skipif.inc'); 7?> 8--FILE-- 9<?php 10 11$fillColor = 'rgb(0, 0, 0)'; 12$fuzz = 0.2; 13$targetColor = 'rgb(245, 124, 24)'; 14$x = 260; 15$y = 150; 16$inverse = 0; 17$channel = Imagick::CHANNEL_DEFAULT; 18 19function floodFillPaintImage($fillColor, $fuzz, $targetColor, $x, $y, $inverse, $channel) { 20 $imagick = new \Imagick(); 21 $imagick->newPseudoImage(640, 480, "magick:logo"); 22 23 $imagick->floodFillPaintImage( 24 $fillColor, 25 $fuzz * \Imagick::getQuantum(), 26 $targetColor, 27 $x, $y, 28 $inverse, 29 $channel 30 ); 31 $bytes = $imagick->getImageBlob(); 32 if (strlen($bytes) <= 0) { echo "Failed to generate image.";} 33} 34 35floodFillPaintImage($fillColor, $fuzz, $targetColor, $x, $y, $inverse, $channel) ; 36echo "Ok"; 37?> 38--EXPECTF-- 39Ok