From 5b55cb72d33c692f1677341311ec3df05dd0b500 Mon Sep 17 00:00:00 2001 From: hugovk Date: Mon, 12 May 2014 23:33:05 +0300 Subject: [PATCH] Test experimental floodfill with a border --- Tests/images/imagedraw_floodfill2.png | Bin 0 -> 212 bytes Tests/test_imagedraw.py | 17 +++++++++++++++++ 2 files changed, 17 insertions(+) create mode 100644 Tests/images/imagedraw_floodfill2.png diff --git a/Tests/images/imagedraw_floodfill2.png b/Tests/images/imagedraw_floodfill2.png new file mode 100644 index 0000000000000000000000000000000000000000..41b92fb75a032515147d1d63d27f45d61d85f69b GIT binary patch literal 212 zcmeAS@N?(olHy`uVBq!ia0vp^DIm?LEc!(!8PgVbG9L%=Jzf1= J);T3K0RX!!He~<+ literal 0 HcmV?d00001 diff --git a/Tests/test_imagedraw.py b/Tests/test_imagedraw.py index 73617b97a..2a1f963c7 100644 --- a/Tests/test_imagedraw.py +++ b/Tests/test_imagedraw.py @@ -235,4 +235,21 @@ def test_floodfill(): 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