code: def hide(input_image: Union[str, IO[bytes]], message: str):
      
      message_length = len(message)
      assert message_length != 0, "message message_length is zero"
      assert message_length < 255, "message is too long"
      img = tools.open_image(input_image)
      # Use a copy of image to hide the text in
      encoded = img.copy()
      width, height = img.size
      index = 0
      for row in range(height):
          for col in range(width):
              (r, g, b) = img.getpixel((col, row))
              # first value is message_length of message
              if row == 0 and col == 0 and index < message_length:
                  asc = message_length
              elif index <= message_length:
                  c = message[index - 1]
                  asc = ord(c)
              else:
                  asc = r
              encoded.putpixel((col, row), (asc, g, b))
              index += 1
      img.close()
      return encoded
docs: Hide a message (string) in an image.
  
      Use the red portion of a pixel (r, g, b) tuple to
      hide the message string characters as ASCII values.
      The red value of the first pixel is used for message_length of the string.