code: def string_to_img(image_string):
      """Turn a string image representation into a binary image"""
      rows = [
          s for s in image_string.replace(" ", "").split("\n") if len(s)
      ]
      height = len(rows)
      width = len(rows[0])
      im = Image.new("L", (width, height))
      for i in range(width):
          for j in range(height):
              c = rows[j][i]
              v = c in "X1"
              im.putpixel((i, j), v)
  
      return im
  
imports: from __future__ import annotations
  import pytest
  from PIL import Image, ImageMorph, _imagingmorph
  from .helper import assert_image_equal_tofile, hopper
label_desc: Use image node_id 1 for calling a global function with example usage: string_to_img(image_string) and returns: im