[pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci
This commit is contained in:
pre-commit-ci[bot] 2022-02-07 14:33:21 +00:00
parent 9a78e37936
commit db137d688d

View File

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