diff --git a/ocr4all_helpers/pagelineseg.py b/ocr4all_helpers/pagelineseg.py index 0cda7a8..6750113 100644 --- a/ocr4all_helpers/pagelineseg.py +++ b/ocr4all_helpers/pagelineseg.py @@ -212,7 +212,7 @@ def segment(im, scale=None, """ colors = im.getcolors(2) - if im.mode != '1' and not (colors is not None and len(colors) == 2): + if (im.mode not in ['1', "L"]) and not (colors is not None and len(colors) == 2): raise ValueError('Image is not bi-level') # rotate input image for vertical lines