We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f018518 commit ecb64feCopy full SHA for ecb64fe
Tests/test_imageops.py
@@ -63,6 +63,7 @@ def test_sanity():
63
ImageOps.grayscale(hopper("L"))
64
ImageOps.grayscale(hopper("RGB"))
65
66
+ ImageOps.invert(hopper("1"))
67
ImageOps.invert(hopper("L"))
68
ImageOps.invert(hopper("RGB"))
69
src/PIL/ImageOps.py
@@ -523,7 +523,7 @@ def invert(image):
523
lut = []
524
for i in range(256):
525
lut.append(255 - i)
526
- return _lut(image, lut)
+ return image.point(lut) if image.mode == "1" else _lut(image, lut)
527
528
529
def mirror(image):
0 commit comments