code: def _make_encoded_image(img_tensor):
      pil_img = Image.fromarray(
          np.squeeze(img_tensor * 255).astype(np.uint8), mode="L"
      )
      buff = io.BytesIO()
      pil_img.save(buff, format="png")
      encoded_image = buff.getvalue()
      return encoded_image
  
imports: import io
  import numpy
  from PIL import Image
  from six.moves import zip_longest
  from skimage import draw
  import tensorflow.compat.v1
label_desc: Use image node_id 33 for calling a global function with example usage: _make_encoded_image(img_tensor) and returns: encoded_image