code: def filter_ocr_image(page, image):
      if page.options.grayscale_ocr:
          log.info("graying")
          return image.convert("L")
      return image
  
file_path: OCRmyPDF/misc/example_plugin.py
imports: from __future__ import annotations
  import logging
  from PIL import Image
  from ocrmypdf import hookimpl
label_desc: Use image node_id 4 for calling a global function with example usage: filter_ocr_image(page, image) and returns: image, image