possible bug - -draw floodfill not gravity sensitive

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 - -draw floodfill not gravity sensitive

Post by fmw42 »

According to the docs at http://www.imagemagick.org/Usage/draw/#color, -draw should be gravity sensitive. But it always seems to floodfill from the upper left corner (the default gravity) as in the following example. I have tested numerous releases back to 6.7.5.10 and none of them seem to work correctly. In the following I am trying to floodfill from the south east corner, without having to know the coordinates of that corner.

input:
Image

Code: Select all

convert black_diamond.jpg -gravity SouthEast -fuzz 10% -fill black \
-draw "color 0,0 floodfill"  black_diamond_filled.jpg
Image

A workaround would be to either get the proper coordinates ahead of time or rotate the image 180 degrees, floodfill, then rotate back. But the point is to do this with gravity.
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: possible bug - -draw floodfill not gravity sensitive

Post by magick »

Quoting from http://www.imagemagick.org/Usage/draw/#color:
These last two fill type operations are currently the only draw operations that are affected by "-gravity".
That is, -draw text and -draw image. Gravity is not supported for any other draw operation.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: possible bug - -draw floodfill not gravity sensitive

Post by fmw42 »

Sorry, I overlooked that comment.
Post Reply