Powerpoint + PIL + png = Animated Gif

From the title you guessed that in this post we will:

So the procedure is this:

Let’s go to watch the video to see exactly what do I mean.

Show the code to make animated gif

Here is the code

from PIL import Image
import glob
 
# Create the frames
frames = []
imgs = glob.glob("*.png")
for i in imgs:
    new_frame = Image.open(i)
    frames.append(new_frame)
 
# Save into a GIF file that loops forever
frames[0].save('png_to_gif.gif', format='GIF',
               append_images=frames[1:],
               save_all=True,
               duration=300, loop=0)

As I already wrote aboce, put the file saved as pnggif.py (for example) in the folder where the png files are and run the file. To run the file you can go in the address bar click on it (on the right side) and write cmd. When the cmd opens, write: python pnggif.py (or whatever you called the file and the game is done).