Skip to content

Commit

Permalink
ImageStat: simplify call to Image.histogram(mask)
Browse files Browse the repository at this point in the history
Co-authored-by: Hugo van Kemenade <[email protected]>
  • Loading branch information
nulano and hugovk authored Apr 16, 2024
1 parent bcb2db6 commit 8b62538
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/PIL/ImageStat.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,7 @@ def __init__(
:param mask: An optional mask.
"""
if isinstance(image_or_list, Image.Image):
if mask:
self.h = image_or_list.histogram(mask)
else:
self.h = image_or_list.histogram()
self.h = image_or_list.histogram(mask)
else:
self.h = image_or_list
if not isinstance(self.h, list):
Expand Down

0 comments on commit 8b62538

Please sign in to comment.