Test experimental floodfill with a border

This commit is contained in:
hugovk 2014-05-12 23:33:05 +03:00
parent 961db29ff6
commit 5b55cb72d3
2 changed files with 17 additions and 0 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 212 B

View File

@ -235,4 +235,21 @@ def test_floodfill():
assert_image_equal(im, Image.open("Tests/images/imagedraw_floodfill.png")) assert_image_equal(im, Image.open("Tests/images/imagedraw_floodfill.png"))
def test_floodfill_border():
# Arrange
im = Image.new("RGB", (w, h))
draw = ImageDraw.Draw(im)
draw.rectangle(bbox2, outline="yellow", fill="green")
centre_point = (int(w/2), int(h/2))
# Act
ImageDraw.floodfill(
im, centre_point, ImageColor.getrgb("red"),
border=ImageColor.getrgb("black"))
del draw
# Assert
assert_image_equal(im, Image.open("Tests/images/imagedraw_floodfill2.png"))
# End of file # End of file