gif循环播放
We all know animated GIFs put the "fun" in "functional." I've recently written incredible posts with regard to animated GIF images, including:
我们都知道动画GIF将“有趣”置于“功能”中。 我最近写过 难以置信 有关动画GIF图像的帖子,包括:
One bit of information that has eluded me is how to control the loop count of an animated GIF. Say you have an animated GIF and you only want to limit the number of times the GIF can loop, or even prevent looping of the GIF -- it's super simple with gifsicle!
让我难忘的一点信息是如何控制动画GIF的循环计数。 假设您拥有动画GIF,而您只想限制GIF可以循环播放的次数,甚至可以防止GIF循环播放-gifsicle超级简单!
防止GIF循环 (Prevent GIF Looping)
gifsicle provides a --no-loopcount
option when you process a GIF:
当您处理GIF时,gifsicle提供了--no-loopcount
选项:
gifsicle herrera-wtf.gif --no-loopcount > herrera-wtf-once.gif
The resulting GIF plays once and then stops:
产生的GIF播放一次,然后停止:
单击上面的图像以重新启动它 。
循环播放GIF {x}次 (Loop a GIF {x} Times)
Another gifsicle command line option, --loopcount
, allows for you to set any number as the loop count of the image:
另一个gifsicle命令行选项--loopcount
允许您设置任何数字作为图像的循环计数:
gifsicle jack-slow.gif --loopcount=3 > herrera-wtf-four-plays.gif
The --loopcount
is set to 3
, meaning the GIF actually plays 4 times (original, then 3 loops).
--loopcount
设置为3
,这意味着GIF实际上播放了4次(原始,然后是3个循环)。
Why you'd want a GIF to loop at any specific amount is unknown to me, but the ability to prevent looping is certainly useful, if only to cut down on how expensive the animation is!
我不知道为什么要让GIF以任何特定的大小循环播放,但是防止循环播放的功能肯定有用,即使只是为了减少动画的价格!
gif循环播放