File tree Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -222,18 +222,18 @@ def test_p_la():
222
222
assert_image_similar (alpha , comparable , 5 )
223
223
224
224
225
- def test_p_pa ():
225
+ def test_p2pa_alpha ():
226
226
with Image .open ("Tests/images/tiny.png" ) as im :
227
227
assert im .mode == "P"
228
228
229
229
im_pa = im .convert ("PA" )
230
- assert im_pa .mode == "PA"
230
+ assert im_pa .mode == "PA"
231
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
- )
232
+ im_a = im_pa . getchannel ( "A" )
233
+ for x in range ( 4 ):
234
+ alpha = 255 if x > 1 else 0
235
+ for y in range ( 4 ):
236
+ assert im_a . getpixel (( x , y )) == alpha
237
237
238
238
239
239
def test_matrix_illegal_conversion ():
You can’t perform that action at this time.
0 commit comments