简体   繁体   中英

Python ImageIO Gif Set Delay Between Frames

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM