6

I am using ImageIO: https://imageio.readthedocs.io/en/latest/userapi.html , and I want to know how to set delay between frames in a gif.

Here are the relevant parts of my code.

import imageio 
. . . 
imageio.mimsave(args.output + '.gif', ARR_ARR)

where ARR_ARR is an array of numpy uint8 2d array of couplets.

To be clear, I have no problem writing the gif. I cannot, however, find any clarification on being able to write the amount of delay between frames.

So, for example, I have frames 0 ... 9

They always play at the same rate. I would like to be able to control the number of milliseconds or whatever unit between frames being played.

Harald K
  • 26,314
  • 7
  • 65
  • 111
Cade Brown
  • 165
  • 2
  • 8

1 Answers1

7

Found it using imageio.help("GIF") you would pass in something like

imageio.mimsave(args.output + '.gif', ARR_ARR, fps=$FRAMESPERSECOND)

And that seems to work.

Cade Brown
  • 165
  • 2
  • 8