From 665b4140333d359a1e621cb1a7448d3866ced146 Mon Sep 17 00:00:00 2001 From: Navneeth Subramanian Date: Fri, 7 Aug 2020 14:15:55 +0900 Subject: [PATCH] Update src/PIL/ImageOps.py Co-authored-by: Hugo van Kemenade --- src/PIL/ImageOps.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/PIL/ImageOps.py b/src/PIL/ImageOps.py index a6b7375a5..6cb2ba964 100644 --- a/src/PIL/ImageOps.py +++ b/src/PIL/ImageOps.py @@ -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]