【发布时间】:2018-07-23 17:38:29
【问题描述】:
我尝试以不同的延迟加入两个不同的 gif,但最终 output.gif 具有相同的延迟,没有不同...有没有办法在一个 gif 中具有不同的延迟?
import subprocess
import os
def mk(i, o, delay=100):
subprocess.call("convert -delay " +
delay + " -loop 5 " + i + " " + o, shell=True)
delay = input("Delay (default 100): ")
# mk("*png", "gif1, delay) # I used this to make the 2 gif
# with a delay of 100 and 30 respectively
# and then I joined them with the code below, but I dunno how to
# give them a separate delay... I want them one after the other
# in order of time
mk("*.gif", "output.gif", delay)
os.system("start output.gif")
【问题讨论】:
-
可能是因为您的
-delay对所有图像都相同,或者我没有得到您。 -
我使用上面的代码在一定延迟 (100) 时制作 gif 编号 1,并使用相同的代码制作带有延迟 (30) 的编号 2 gif。为此,我使用了 .png 图像。然后我更改为 *.gif 并将两个 gif 连接在一起,但是,很明显,它们都在 100 处......有没有办法将 gif1(延迟 100)和 gif 2(延迟 30 ),在同一个 gif 中留下不同的延迟? ...我认为答案不是,但是,谁知道呢...我希望第一部分为 100,而当第二部分开始时,它为 30。
-
看起来有可能,看看this线程
-
为什么还要指定延迟?只需省略
-delay和convert即可完成您想要的操作 -
请提供 2 个 GIF。 “组合” 是什么意思?播放 GIF1 然后播放 GIF2?在屏幕左侧播放 GIF1 而在右侧播放 GIF2?
标签: python imagemagick gif animated-gif imagemagick-convert