We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 84da709 + b0bc74a commit 7f39a21Copy full SHA for 7f39a21
Tests/test_image_convert.py
@@ -222,18 +222,18 @@ def test_p_la():
222
assert_image_similar(alpha, comparable, 5)
223
224
225
-def test_p_pa():
+def test_p2pa_alpha():
226
with Image.open("Tests/images/tiny.png") as im:
227
assert im.mode == "P"
228
229
im_pa = im.convert("PA")
230
- assert im_pa.mode == "PA"
+ assert im_pa.mode == "PA"
231
232
- assert (
233
- im_pa.tobytes() == b"\x00\x00\x00\x00\x08\xff\x04\xff\x00\x00\x00\x00"
234
- b"\x06\xff\x07\xff\x00\x00\x00\x00\x02\xff\x03\xff\x00"
235
- b"\x00\x00\x00\x01\xff\x05\xff"
236
- )
+ im_a = im_pa.getchannel("A")
+ for x in range(4):
+ alpha = 255 if x > 1 else 0
+ for y in range(4):
+ assert im_a.getpixel((x, y)) == alpha
237
238
239
def test_matrix_illegal_conversion():
0 commit comments