note 106185 added to function.imagick-painttransparentimage
| From: | alain at ocarina dot fr | Date: | Mon, 17 Oct 2011 21:14:48 +0000 |
| Subject: | note 106185 added to function.imagick-painttransparentimage | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-183940@lists.php.net to get a copy of this message | ||
The fuzz is just working well in a range of 0 to 65535.
I suggest you to try to move fuzz on a color spectrum image.
1/ Get a color spectrum ( Google Image has a lot )
2/ Try this code :
<?php
function fuzzTest($source, $target, $fuzz) {
// Loads image
$im = new Imagick($source);
// Resizes images to make them easily comparable
$im->resizeImage(320, 240, Imagick::FILTER_LANCZOS, 1, true);
// Apply fuzz
$im->paintTransparentImage($im->getImagePixelColor(0, 0), 0, $fuzz);
// Writes image
$im->setImageFormat('png');
$im->writeImage($target);
$im->destroy();
return true;
}
for ($i = 0; ($i <= 10); $i++) {
fuzzTest('spectrum.png', "test_{$i}.png", (6553.5 * $i));
echo '<img src="test_' . $i . '.png" /> ';
}
?>
----
Server IP: 195.221.21.36
Probable Submitter: 78.238.154.150
----
Manual Page -- http://www.php.net/manual/en/function.imagick-painttransparentimage.php
Edit -- https://master.php.net/note/edit/106185
Del: integrated -- https://master.php.net/note/delete/106185/integrated
Del: useless -- https://master.php.net/note/delete/106185/useless
Del: bad code -- https://master.php.net/note/delete/106185/bad+code
Del: spam -- https://master.php.net/note/delete/106185/spam
Del: non-english -- https://master.php.net/note/delete/106185/non-english
Del: in docs -- https://master.php.net/note/delete/106185/in+docs
Del: other reasons-- https://master.php.net/note/delete/106185
Reject -- https://master.php.net/note/reject/106185
Search -- https://master.php.net/manage/user-notes.php