code: def text_to_rgba(s, *, dpi, **kwargs):
      # To convert a text string to an image, we can:
      # - draw it on an empty and transparent figure;
      # - save the figure to a temporary buffer using ``bbox_inches="tight",
      #   pad_inches=0`` which will pick the correct area to save;
      # - load the buffer using ``plt.imread``.
      #
      # (If desired, one can also directly save the image to the filesystem.)
      fig = Figure(facecolor="none")
      fig.text(0, 0, s, **kwargs)
      with BytesIO() as buf:
          fig.savefig(
              buf,
              dpi=dpi,
              format="png",
              bbox_inches="tight",
              pad_inches=0,
          )
          buf.seek(0)
          rgba = plt.imread(buf)
      return rgba
  
imports: from io import BytesIO
  import matplotlib.pyplot
  from matplotlib.figure import Figure
  from matplotlib.transforms import IdentityTransform
label_desc: Use image node_id 1 for calling a global function with example usage: text_to_rgba(s) and returns: rgba