Update src/PIL/ImageOps.py

Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
This commit is contained in:
Navneeth Subramanian 2020-08-07 14:15:55 +09:00 committed by GitHub
parent 8fad541531
commit 665b414033
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -79,10 +79,7 @@ def autocontrast(image, cutoff=0, ignore=None, mask=None):
for histogram computation.
:return: An image.
"""
if mask:
histogram = image.histogram(mask)
else:
histogram = image.histogram()
histogram = image.histogram(mask)
lut = []
for layer in range(0, len(histogram), 256):
h = histogram[layer : layer + 256]