possible bug -floodfill IM 6.7.0.5 Q16

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
Post Reply
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

possible bug -floodfill IM 6.7.0.5 Q16

Post 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
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: possible bug -floodfill IM 6.7.0.5 Q16

Post by magick »

Try this command:
  • convert boxes_flood1.gif -fuzz 1% -fill white -floodfill +50+50 black x:
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: possible bug -floodfill IM 6.7.0.5 Q16

Post 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
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: possible bug -floodfill IM 6.7.0.5 Q16

Post 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.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: possible bug -floodfill IM 6.7.0.5 Q16

Post 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
Post Reply