From 27c40910d83a028fde18b9da84e6031443a96c12 Mon Sep 17 00:00:00 2001 From: Hamza <52637755+millionhz@users.noreply.github.com> Date: Wed, 1 Jul 2020 19:01:53 +0500 Subject: [PATCH] Update src/PIL/ImageOps.py Yup you are absolutely correct; it does the job in fewer lines of code too. Co-authored-by: Andrew Murray <3112309+radarhere@users.noreply.github.com> --- src/PIL/ImageOps.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/PIL/ImageOps.py b/src/PIL/ImageOps.py index 24f6a3b6b..008ec0238 100644 --- a/src/PIL/ImageOps.py +++ b/src/PIL/ImageOps.py @@ -88,12 +88,8 @@ def autocontrast(image, cutoff=0, ignore=None): h[ix] = 0 if cutoff: # cut off pixels from both ends of the histogram - if isinstance(cutoff, int): + if not isinstance(cutoff, tuple): cutoff = (cutoff, cutoff) - elif isinstance(cutoff, tuple): - pass - else: - raise ValueError("the cutoff can only be a integer or tuple") # get number of pixels n = 0 for ix in range(256):