Python ImageIO Gif设置帧之间的延迟 [英] Python ImageIO Gif Set Delay Between Frames

查看:1639
本文介绍了Python ImageIO Gif设置帧之间的延迟的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用ImageIO: https://imageio.readthedocs.io/en/latest /userapi.html ,我想知道如何设置gif中帧之间的延迟。



以下是我的代码的相关部分。

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

其中 ARR_ARR 是一个 numpy uint8 2d对联数组的数组。



<要说清楚,我写gif没问题。但是,我不能找到任何关于能够在帧之间写入延迟量的说明。



所以,例如,我有0 ... 9的帧



他们总是以相同的速度玩。我希望能够控制正在播放的帧之间的毫秒数或任何单位。

解决方案

使用<$找到它c $ c> imageio.help(GIF)你会传递类似



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



这似乎有效。


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.

这篇关于Python ImageIO Gif设置帧之间的延迟的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆