'Run a single morphological operation on an image
Returns a tuple of the number of changed pixels and the
morphed image'

def apply(self, image):

    if (self.lut is None):
        raise Exception('No    operator    loaded')
    if (image.mode != 'L'):
        raise Exception('Image    must    be    binary,    meaning    it    must    use    mode    L')
    outimage = Image.new(image.mode, image.size, None)
    count = _imagingmorph.apply(bytes(self.lut), image.im.id, outimage.im.id)
    return (count, outimage)
