Page 1 of 1

possible bug -floodfill IM 6.7.0.5 Q16

Posted: 2011-06-08T14:59:48-07:00
by fmw42
IM 6.7.0.5 Q16 Mac OSX tiger

Perhaps I am doing something wrong. But I get wrong results using -floodfill vs -draw "color ... floodfill"

Input:
Image

This works fine using -draw whether gif or png output:

infile="boxes.gif"
coords=`convert $infile -format "%[fx:w/2],%[fx:h/2]" info:`
echo $coords
convert $infile -fuzz 1% -fill white -draw "color $coords floodfill" boxes_flood2.gif

Image

infile="boxes.gif"
coords=`convert $infile -format "%[fx:w/2],%[fx:h/2]" info:`
echo $coords
convert $infile -fuzz 1% -fill white -draw "color $coords floodfill" boxes_flood2.png

Image


But this does not seem to work (using either gif or png). Perhaps I am doing something wrong or misinterpretting http://www.imagemagick.org/script/comma ... #floodfill


infile="boxes.gif"
coords=`convert $infile -format "+%[fx:w/2]+%[fx:h/2]" info:`
echo $coords
convert $infile -fuzz 1% -floodfill $coords white boxes_flood1.gif

Image

infile="boxes.gif"
coords=`convert $infile -format "+%[fx:w/2]+%[fx:h/2]" info:`
echo $coords
convert $infile -fuzz 1% -floodfill $coords white boxes_flood1.png

Image

Re: possible bug -floodfill IM 6.7.0.5 Q16

Posted: 2011-06-08T16:40:47-07:00
by magick
Try this command:
  • convert boxes_flood1.gif -fuzz 1% -fill white -floodfill +50+50 black x:

Re: possible bug -floodfill IM 6.7.0.5 Q16

Posted: 2011-06-08T17:08:06-07:00
by fmw42
magick wrote:Try this command:
  • convert boxes_flood1.gif -fuzz 1% -fill white -floodfill +50+50 black x:
I believe you mean:

convert boxes.gif -fuzz 1% -fill white -floodfill +50+50 black show:

and that does work. I had a feeling I was doing something wrong.

However, the docs are not clear about this as I assumed that it would find the color at the coordinates and needed to know the new color.

So I will modify the docs to make it more clear.

Thanks.

Fred

Re: possible bug -floodfill IM 6.7.0.5 Q16

Posted: 2011-06-08T18:43:12-07:00
by anthony
You can think of -floodfill as like 'opaque' with a specific color, and a start (seed) point. if that seed point is not withing fuzz of the color you are looking for -floodfill does nothing.

The need for the seed color, was my idea as I wanted a way to specify the 'center' of a fuzz.

I am starting to think that it was a bad idea, as it simply seem to cause more problems than it is worth, as everyone assumes the seed pixel color is what would be used as the center of the fuzz match.


I have updated IM Examples, Color Basics, Floodfill Operator (give it a couple of hours)
http://www.imagemagick.org/Usage/color_ ... #floodfill
to point out this connection to 'opaque', and how it actually works.

Fred, prehaps you like to update -floodfill option reference with what I just pointed out.

Re: possible bug -floodfill IM 6.7.0.5 Q16

Posted: 2011-06-08T19:46:40-07:00
by fmw42
Fred, prehaps you like to update -floodfill option reference with what I just pointed out.
I already did. Will take a day I guess to filter through.

Feel free to modify if you want.

Fred