code: def _make_image(tensor):
      
      assert isinstance(tensor, NDArray)
      if Image is None:
          raise ImportError('need to install PIL for visualizing images')
      height, width, channel = tensor.shape
      tensor = _make_numpy_array(tensor)
      image = Image.fromarray(tensor)
      output = io.BytesIO()
      image.save(output, format='PNG')
      image_string = output.getvalue()
      output.close()
      return Summary.Image(height=height, width=width, colorspace=channel,
                           encoded_image_string=image_string)
docs: Converts an NDArray type image to Image protobuf