diff --git a/pixelocr/image.py b/pixelocr/image.py index efe94ba..83f554e 100644 --- a/pixelocr/image.py +++ b/pixelocr/image.py @@ -19,7 +19,6 @@ from io import BytesIO import numpy as np from skimage.io import imread, imsave -from skimage.color import rgb2gray from .utils import cached_property, pairwise @@ -156,9 +155,7 @@ class Image(object): 0 = white (blank) pixel 1 = black (glyph) pixel """ - - grayscale = rgb2gray(self.data) - return (grayscale < 1).astype('b') + return (self.data != 255).any(axis=2) @cached_property def isspace(self):