Merge pull request #6034 from radarhere/imageops

This commit is contained in:
Hugo van Kemenade 2022-03-30 16:16:57 +03:00 committed by GitHub
commit 4bc6483564
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 1 deletions

View File

@ -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"))

View File

@ -525,7 +525,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):