File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -128,7 +128,7 @@ def process(self):
128
128
else :
129
129
background = background .median [0 ]
130
130
if level == 'region' :
131
- background_image = Image .new ('L' , page_image .size , background )
131
+ background_image = Image .new (page_image . mode , page_image .size , background )
132
132
page_array = pil2array (page_image )
133
133
page_bin = np .array (page_array <= midrange (page_array ), np .uint8 )
134
134
# in absolute coordinates merely for comparison/intersection
@@ -172,7 +172,7 @@ def process(self):
172
172
continue
173
173
region_image , region_coords = self .workspace .image_from_segment (
174
174
region , page_image , page_coords , feature_selector = 'binarized' )
175
- background_image = Image .new ('L' , region_image .size , background )
175
+ background_image = Image .new (region_image . mode , region_image .size , background )
176
176
region_array = pil2array (region_image )
177
177
region_bin = np .array (region_array <= midrange (region_array ), np .uint8 )
178
178
# in absolute coordinates merely for comparison/intersection
You can’t perform that action at this time.
0 commit comments