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.
2 parents a6efaa1 + ecb64fe commit 4bc6483Copy full SHA for 4bc6483
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
@@ -525,7 +525,7 @@ def invert(image):
525
lut = []
526
for i in range(256):
527
lut.append(255 - i)
528
- return _lut(image, lut)
+ return image.point(lut) if image.mode == "1" else _lut(image, lut)
529
530
531
def mirror(image):
0 commit comments