diff --git a/src/PIL/Image.py b/src/PIL/Image.py index 8ab67d55e..c046e6258 100644 --- a/src/PIL/Image.py +++ b/src/PIL/Image.py @@ -1733,6 +1733,11 @@ class Image: ): # RGB or RGBA value for a P image value = self.palette.getcolor(value) + + if self.mode = "L": + if (type(xy[0]) is not int) or (type(xy[1]) is not int): + raise TypeError(f"Expected argument xy to be a tuple (int, int) but got { xy }") + return self.im.putpixel(xy, value) def remap_palette(self, dest_map, source_palette=None):