mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-12-26 01:46:18 +03:00
Round lut values where necessary
This commit is contained in:
parent
4996f84fb3
commit
42f67d184a
|
@ -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):
|
||||
|
|
|
@ -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):
|
||||
|
|
Loading…
Reference in New Issue
Block a user