code: def _run(self, encoded: np.ndarray, pixel_format="RGB") -> tuple[np.ndarray]:  # type: ignore
      try:
          import PIL.Image
      except ImportError as e:
          raise ImportError(
              "Pillow must be installed to use the reference implementation of the ImageDecoder operator"
          ) from e
      img = PIL.Image.open(io.BytesIO(encoded.tobytes()))
      if pixel_format == "BGR":
          decoded = np.array(img)[:, :, ::-1]
      elif pixel_format == "RGB":
          decoded = np.array(img)
      elif pixel_format == "Grayscale":
          img = img.convert("L")
          decoded = np.array(img)
          decoded = np.expand_dims(
              decoded, axis=2
          )  # (H, W) to (H, W, 1)
      else:
          raise ValueError(
              f"pixel_format={pixel_format!r} is not supported."
          )
      return (decoded,)
  
imports: from __future__ import annotations
  import io
  import numpy
  from onnx.reference.op_run import OpRun
label_desc: Use image node_id 1 for calling the ImageDecoder obj's underlying member method code with example usage: obj._run(encoded, pixel_format) and returns: decoded