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图像的帖子,包括:
Detect if a GIF is Animated
检测GIF是否为动画
Merge GIFs with gifsicle
将GIF与Gificle合并
Optimize GIF Images
优化GIF图像
Convert Video to GIF or GIF to Video
将视频转换为GIF或将GIF转换为视频
Get the First Frame of an Animated GIF with ImageMagick
使用ImageMagick获取动画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超级简单!
gifsicle provides a --no-loopcount option when you process a GIF:
当您处理GIF时,gifsicle提供了--no-loopcount选项:
gifsicle herrera-wtf.gif --no-loopcount > herrera-wtf-once.gifThe resulting GIF plays once and then stops:
产生的GIF播放一次,然后停止:
Click the image above to restart it.单击上面的图像以重新启动它 。
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.gifThe --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以任何特定的大小循环播放,但是防止循环播放的功能肯定有用,即使只是为了减少动画的价格!
翻译自: https://davidwalsh.name/prevent-gif-loop
gif循环播放