I play with animated gifs in Python, where frames will be created using a raspberry Pi camera located in a greenhouse. I have successfully used the recommended image code from Almar to answer the previous question in order to create simple gifs.
However, now I'm trying to slow down the frame duration, but I look at the documentation for imageio and cannot find any links for mimsave, but see mimwrite , which should take four arguments. I have looked through additional documentation and see that there is a duration argument.
Currently, my code looks like this:
exportname = "output.gif" kargs = { 'duration': 5 } imageio.mimsave(exportname, frames, 'GIF', kargs)
and I get the following error:
Traceback (most recent call last): File "makegif.py", line 23, in <module> imageio.mimsave(exportname, frames, 'GIF', kargs) TypeError: mimwrite() takes at most 3 arguments (4 given)
where frames is a list of imageio.imread objects. Why is this?
UPDATED SHOW FULL RESPONSE: This is an example showing how to create animated gifs with an image using kwargs to change the frame duration.
import imageio import os import sys if len(sys.argv) < 2: print("Not enough args - add the full path") indir = sys.argv[1] frames = []
source share