We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4f3947d commit 998c1a4Copy full SHA for 998c1a4
ocrd_cis/ocropy/clip.py
@@ -121,7 +121,12 @@ def process(self):
121
page.get_UnknownRegion())
122
if not num_texts:
123
LOG.warning('Page "%s" contains no text regions', page_id)
124
- background = ImageStat.Stat(page_image).median[0]
+ background = ImageStat.Stat(page_image)
125
+ # workaround for Pillow#4925
126
+ if len(background.bands) > 1:
127
+ background = tuple(background.median)
128
+ else:
129
+ background = background.median[0]
130
if level == 'region':
131
background_image = Image.new('L', page_image.size, background)
132
page_array = pil2array(page_image)
0 commit comments