Page 1 of 1

matteFloodfillImage doesn't work as expected

Posted: 2008-10-13T21:21:25-07:00
by colorpyen
Using latest imagick PHP extension downloaded from PECL 2.2.1RC2 and ImageMagick version 6.4.4

Tried to mimic the similar behavior of the following script to remove background using Imagick extension, but failed to get it work using Imagick even with a larger fuzz factor. Any pointers are highly appreciated.

Thanks a lot.

-peter

convert test.png -bordercolor white -border 1x1 -matte \
-fill none -fuzz 1% -draw 'matte 1,1 floodfill' test.png

<?php

$im = new Imagick('test.png');
$im->matteFloodfillImage(1.0, 50, new ImagickPixel('white'), 10, 10);
echo $im;
?>

Re: matteFloodfillImage doesn't work as expected

Posted: 2008-10-15T05:50:22-07:00
by colnector
I've tried it as well and couldn't get it to work. It seems this forum is dead :(

viewtopic.php?f=18&t=12118

Re: matteFloodfillImage doesn't work as expected

Posted: 2008-10-20T13:46:40-07:00
by mkoppanen
Far from dead :)

I am currently very busy at work so that cuts down the time I can "hang around" at forums. This should ease up after Wednesday!

Re: matteFloodfillImage doesn't work as expected

Posted: 2008-10-20T18:18:02-07:00
by colnector
Well, if I get a good complete answer on Wednesday I'll be happy. 10x

Re: matteFloodfillImage doesn't work as expected

Posted: 2009-04-17T01:59:36-07:00
by pooco
same issue; doesnt work as expected. anyone get this going?

Re: matteFloodfillImage doesn't work as expected

Posted: 2009-04-17T02:11:57-07:00
by colnector
This is the part of the code that currently work more or less well for collectible coins on my site

Code: Select all

			if ($bFakeTransparency) {
				$ipColor = $im->getImagePixelColor(1, 1);
				$im->borderImage($ipColor, 1, 1);
				
				$im->paintFloodfillImage("#e8f0fc", 12000, $ipColor, 1 , 1);
				$im->shaveImage(1, 1);		
			}	

Re: matteFloodfillImage doesn't work as expected

Posted: 2009-04-17T02:24:52-07:00
by pooco
thank you!
was just about to post this:

$canvas->paintTransparentImage('color', 0, 400);

read more in user comments here:
http://www.php.net/manual/en/function.i ... timage.php

hopefully i can figure out better png alpha transparency support now.

Re: matteFloodfillImage doesn't work as expected

Posted: 2009-04-17T02:31:39-07:00
by colnector
You're most welcomed :) I was actually using this method since I'm displaying JPGs. Using PNGs is out of the question due to image size. If new ideas come to mind (you can see on my site not all the automatic choices are perfect, to say the least), please update. Thanks.