Added test that translucent polygon pixels do not combine

This commit is contained in:
Andrew Murray 2021-11-16 11:12:48 +11:00
parent ca15c684ea
commit d7873e02ab
2 changed files with 13 additions and 0 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 385 B

View File

@ -638,6 +638,19 @@ def test_polygon_1px_high():
assert_image_equal_tofile(im, expected)
def test_polygon_translucent():
# Arrange
im = Image.new("RGB", (W, H))
draw = ImageDraw.Draw(im, "RGBA")
# Act
draw.polygon([(20, 80), (80, 80), (80, 20)], fill=(0, 255, 0, 127))
# Assert
expected = "Tests/images/imagedraw_polygon_translucent.png"
assert_image_equal_tofile(im, expected)
def helper_rectangle(bbox):
# Arrange
im = Image.new("RGB", (W, H))