Skip to content

Do not allow floodfill to extend into negative coordinates#4017

Merged
hugovk merged 1 commit intopython-pillow:masterfrom
radarhere:floodfill
Sep 5, 2019
Merged

Do not allow floodfill to extend into negative coordinates#4017
hugovk merged 1 commit intopython-pillow:masterfrom
radarhere:floodfill

Conversation

@radarhere
Copy link
Copy Markdown
Member

Resolves #4016

At the moment, ImageDraw.floodfill doesn't stop filling new pixels just because their coordinates happen to be negative - when filling the next pixels around (0, 0), it also uses (-1, -1). So it continues, and wraps around to the other side of the image.

To demonstrate, with this image -

base

filling a coordinate in the upper left of this image before this fix gives -

out

This PR fixes it -

imagedraw_floodfill_not_negative

@radarhere radarhere mentioned this pull request Aug 9, 2019
@radarhere radarhere added the Bug Any unexpected behavior, until confirmed feature. label Aug 9, 2019
@hugovk hugovk merged commit cb1ebc0 into python-pillow:master Sep 5, 2019
@radarhere radarhere deleted the floodfill branch September 5, 2019 20:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug Any unexpected behavior, until confirmed feature.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

floodfill wraps around

2 participants