Skip to content

Commit a251270

Browse files
authored
Merge pull request #7355 from radarhere/getpixel
2 parents 091ab74 + f9f367f commit a251270

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

Tests/test_image_access.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,10 @@ def check(self, mode, expected_color=None):
213213
def test_basic(self, mode):
214214
self.check(mode)
215215

216+
def test_list(self):
217+
im = hopper()
218+
assert im.getpixel([0, 0]) == (20, 20, 70)
219+
216220
@pytest.mark.parametrize("mode", ("I;16", "I;16B"))
217221
@pytest.mark.parametrize(
218222
"expected_color", (2**15 - 1, 2**15, 2**15 + 1, 2**16 - 1)

src/PIL/Image.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1565,7 +1565,7 @@ def getpixel(self, xy):
15651565
self.load()
15661566
if self.pyaccess:
15671567
return self.pyaccess.getpixel(xy)
1568-
return self.im.getpixel(xy)
1568+
return self.im.getpixel(tuple(xy))
15691569

15701570
def getprojection(self):
15711571
"""

0 commit comments

Comments
 (0)