mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-11-10 19:56:47 +03:00
Added test that translucent polygon pixels do not combine
This commit is contained in:
parent
ca15c684ea
commit
d7873e02ab
BIN
Tests/images/imagedraw_polygon_translucent.png
Normal file
BIN
Tests/images/imagedraw_polygon_translucent.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 385 B |
|
@ -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))
|
||||
|
|
Loading…
Reference in New Issue
Block a user