class_docstr: A class for binary morphological operators
class_docstr_tok: ["A","class","for","binary","morphological","operators"]
docstr: Run a single morphological operation on an image
  
  Returns a tuple of the number of changed pixels and the
  morphed image
docstr_tok: ["Run","a","single","morphological","operation","on","an","image","Returns","a","tuple","of","the","number","of","changed","pixels","and","the","morphed","image"]
code: def apply(self, image):
      """Run a single morphological operation on an image
  
      Returns a tuple of the number of changed pixels and the
      morphed image"""
      if self.lut is None:
          raise Exception("No operator loaded")
  
      if image.mode != "L":
          raise ValueError("Image mode must be L")
      outimage = Image.new(image.mode, image.size, None)
      count = _imagingmorph.apply(
          bytes(self.lut), image.im.id, outimage.im.id
      )
      return count, outimage
  
file_path: pillow-simd/src/PIL/ImageMorph.py
imports: import re
  from .None import Image, _imagingmorph
label_desc: Use image node_id 2 for calling the MorphOp obj's underlying member method code with example usage: obj.apply(image) and returns: count,  outimage