Views
No views yet
# Measure the size of the text
text_width, text_height = font.getsize(text)
# Create an image object
image = Image.new('RGB', (text_width, text_height), color='white')
draw = ImageDraw.Draw(image)
# Draw the text
draw.text((0, 0), text, font=font, fill='black')
# Save the image to a list of images
images = [image]
# Create the gif
imageio.mimsave(filename,