mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-11-10 19:56:47 +03:00
Allow 1 mode images to be inverted
This commit is contained in:
parent
f018518e24
commit
ecb64fe210
|
@ -63,6 +63,7 @@ def test_sanity():
|
|||
ImageOps.grayscale(hopper("L"))
|
||||
ImageOps.grayscale(hopper("RGB"))
|
||||
|
||||
ImageOps.invert(hopper("1"))
|
||||
ImageOps.invert(hopper("L"))
|
||||
ImageOps.invert(hopper("RGB"))
|
||||
|
||||
|
|
|
@ -523,7 +523,7 @@ def invert(image):
|
|||
lut = []
|
||||
for i in range(256):
|
||||
lut.append(255 - i)
|
||||
return _lut(image, lut)
|
||||
return image.point(lut) if image.mode == "1" else _lut(image, lut)
|
||||
|
||||
|
||||
def mirror(image):
|
||||
|
|
Loading…
Reference in New Issue
Block a user