![]() Shrinking the images reduced the size: size = (150,150)Ī simple function that makes GIFs: import imageioĭef make_gif(image_directory: pathlib.Path, frames_per_second: float, **kwargs): #images.extend(reversed(images)) #infinit loop will go backwards and forwards. # Numpy images of other types are expected to have values between 0 and 255. # Numpy images of type float should have pixels between 0 and 1. # images should be a list of numpy arrays of PIL images. # Write an animated gif from the specified images. ![]() # writeGif(filename, images, duration=0.1, loops=0, dither=1) Here is the code I used: _author_ = 'Robert'įile_names = sorted((fn for fn in os.listdir('.') if fn.endswith('.png'))) It did seem to double the file size though.Ģ6 110kb PNG files, I expected 26*110kb = 2860kb, but my_gif.GIF was 5.7mbĪlso because the GIF was 8bit, the nice png's became a little fuzzy in the GIF I used images2gif.py which was easy to use.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |