code: def generate_gray_image(self):
      gray = (
          np.tile(np.arange(self._size) / self._size * 255, self._size)
          .reshape(self._size, self._size)
          .astype("uint8")
      )
  
      data = io.BytesIO()
      Image.fromarray(gray).save(data, format="PNG")
      self._data["gray.png"] = data.getvalue()
  
file_path: streamlit/examples/images.py
imports: import io
  import random
  import numpy
  from PIL import Image, ImageDraw
  import streamlit
label_desc: Use image node_id 8 for calling the StreamlitImages obj's underlying member method code with example usage: obj.generate_gray_image() without return types