Skip to content

Commit

Permalink
Merge pull request python-pillow#6188 from radarhere/point
Browse files Browse the repository at this point in the history
  • Loading branch information
hugovk committed Apr 8, 2022
2 parents ec9b0ab + 42f67d1 commit 63f64de
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions Tests/test_image_point.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
2 changes: 2 additions & 0 deletions src/PIL/Image.py
Original file line number Diff line number Diff line change
Expand Up @@ -1720,6 +1720,8 @@ def point(self, data):
# 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):
Expand Down

0 comments on commit 63f64de

Please sign in to comment.