diff --git a/Tests/test_image_point.py b/Tests/test_image_point.py index 366f45854..428ad116b 100644 --- a/Tests/test_image_point.py +++ b/Tests/test_image_point.py @@ -10,6 +10,7 @@ def test_sanity(): im.point(list(range(256))) im.point(list(range(256)) * 3) im.point(lambda x: x) + im.point(lambda x: x * 1.2) im = im.convert("I") with pytest.raises(ValueError): diff --git a/src/PIL/Image.py b/src/PIL/Image.py index aa7e3c2e6..ab391b9b4 100644 --- a/src/PIL/Image.py +++ b/src/PIL/Image.py @@ -1720,6 +1720,8 @@ class Image: # FIXME: _imaging returns a confusing error message for this case raise ValueError("point operation not supported for this mode") + if mode != "F": + lut = [round(i) for i in lut] return self._new(self.im.point(lut, mode)) def putalpha(self, alpha):