@@ -97,6 +97,13 @@ def test_opaque() -> None:
9797 assert_image_equal (alpha , solid )
9898
9999
100+ def test_rgba () -> None :
101+ with Image .open ("Tests/images/transparent.png" ) as im :
102+ assert im .mode == "RGBA"
103+
104+ assert_image_similar (im .convert ("RGBa" ).convert ("RGB" ), im .convert ("RGB" ), 1.5 )
105+
106+
100107def test_rgba_p () -> None :
101108 im = hopper ("RGBA" )
102109 im .putalpha (hopper ("L" ))
@@ -107,6 +114,13 @@ def test_rgba_p() -> None:
107114 assert_image_similar (im , comparable , 20 )
108115
109116
117+ def test_rgba_pa () -> None :
118+ im = hopper ("RGBA" ).convert ("PA" ).convert ("RGB" )
119+ expected = hopper ("RGB" )
120+
121+ assert_image_similar (im , expected , 9.3 )
122+
123+
110124def test_pa () -> None :
111125 im = hopper ().convert ("PA" )
112126
@@ -115,13 +129,6 @@ def test_pa() -> None:
115129 assert palette .colors != {}
116130
117131
118- def test_rgba () -> None :
119- with Image .open ("Tests/images/transparent.png" ) as im :
120- assert im .mode == "RGBA"
121-
122- assert_image_similar (im .convert ("RGBa" ).convert ("RGB" ), im .convert ("RGB" ), 1.5 )
123-
124-
125132def test_trns_p (tmp_path : Path ) -> None :
126133 im = hopper ("P" )
127134 im .info ["transparency" ] = 0
0 commit comments