Convert character(s) to tuple and back
问题 I am trying to change the output of this encoder: https://github.com/akapila011/Text-to-Image/blob/master/text_to_image/encode.py from grayscale to a tri-color scheme such as the one shown here: Tricolor The main lines of code I need to change from the encoder are: img = Image.new("L", size) # grayscale, blank black image ind = 0 for row in range(0, size[0]): for col in range(0, size[1]): if ind < text_length: # only change pixel value for length of text pixel_value = convert_char_to_int(text