mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-12-25 17:36:18 +03:00
Test experimental floodfill()
This commit is contained in:
parent
6b274b4c5e
commit
961db29ff6
BIN
Tests/images/imagedraw_floodfill.png
Normal file
BIN
Tests/images/imagedraw_floodfill.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 232 B |
|
@ -1,6 +1,7 @@
|
|||
from tester import *
|
||||
|
||||
from PIL import Image
|
||||
from PIL import ImageColor
|
||||
from PIL import ImageDraw
|
||||
|
||||
# Image size
|
||||
|
@ -219,4 +220,19 @@ def test_rectangle2():
|
|||
helper_rectangle(bbox2)
|
||||
|
||||
|
||||
def test_floodfill():
|
||||
# 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"))
|
||||
del draw
|
||||
|
||||
# Assert
|
||||
assert_image_equal(im, Image.open("Tests/images/imagedraw_floodfill.png"))
|
||||
|
||||
|
||||
# End of file
|
||||
|
|
Loading…
Reference in New Issue
Block a user