mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-08-20 04:04:45 +03:00
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
This commit is contained in:
parent
9a78e37936
commit
db137d688d
|
@ -521,10 +521,10 @@ def invert(image):
|
|||
:return: An image.
|
||||
"""
|
||||
# Special case for 1-bit images using python translate() method
|
||||
if image.mode == '1':
|
||||
lut = bytearray(range(255,-1,-1))
|
||||
return Image.frombuffer('1',image.size,image.tobytes().translate(lut))
|
||||
|
||||
if image.mode == "1":
|
||||
lut = bytearray(range(255, -1, -1))
|
||||
return Image.frombuffer("1", image.size, image.tobytes().translate(lut))
|
||||
|
||||
lut = []
|
||||
for i in range(256):
|
||||
lut.append(255 - i)
|
||||
|
|
Loading…
Reference in New Issue
Block a user