

With some changes in the code you can make a text move on the screen ( see the post about it and another one with cartoonish kind of animated banners). New_frame = create_image_with_ball(400, 400, x, y, 40)įrames.save('moving_ball.gif', format='GIF',ĭuration=100, loop=0) Moving text example This example is taken from the page coming from this blog: from PIL import Image, ImageDrawĭef create_image_with_ball(width, height, ball_x, ball_y, ball_size): Moving balls: an example of gif generated by PIL # Save into a GIF file that loops foreverįrames.save('moving_text.gif', format='GIF',Īppend_images=frames, save_all=True, duration=30, loop=0) New_frame = create_image_with_text((x-100,y), "HELLO") # and (x1, y1) is the lower-right bound of the box.ĭraw.text((width, height), text, font = fnt, fill="black")

# draw.ellipse takes a 4-tuple (x0, y0, x1, y1) where (x0, y0) is the top-left bound of the box from PIL import Image, ImageDraw, ImageFont In the following code we create the images just with PIL, without having to save them, converting them into a gif in just one “passage”. Automate the creation of the single pngs needed for the animated gif
