We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
它们的命令行工具均可通过 Homebrew 安装,部分有桌面客户端应用。
# 查看所有帧信息 $ gifsicle --info source.gif # 查看某帧信息 $ gifsicle --info "#0" "#3" < source.gif # 查看详细颜色表 $ gifsicle --cinfo source.gif
详见 get_info.sh,它内部依赖 ImageMagick。
$ gifinfo [-n number_of_frames] <filename>
其中 filename 支持网络图片。
filename
使用 ImageMagick
# 逐帧导出 $ convert source.gif target.png
如果 GIF 已经过透明度处理(即第一帧信息完整保留,后续帧仅保留变化的部分,未变的空间均为透明),可通过 Gifsicle 还原,再使用 ImageMagick 处理。
# 还原 $ gifsicle --unoptimize source.gif > tmp.gif # 逐帧导出 $ convert tmp.gif target.png
导出某帧
$ convert 'source.gif[0]' target.png
导出多帧,可以这样指定:source.gif[0-3]、source.gif[3,2,4](非连续帧)。
source.gif[0-3]
source.gif[3,2,4]
使用 macOS 内置的「预览」应用,可以快速插入/删除帧。打开 GIF 并在「菜单栏 - 显示」切换为「缩略清单」。
$ gifsicle source.gif --delete '#1-5' > output.gif
帧索引从 0 开始。 帧数支持负数,比如 #-1 表示倒数第一帧,#0--2 表示前 N - 2 帧。
帧索引从 0 开始。
帧数支持负数,比如 #-1 表示倒数第一帧,#0--2 表示前 N - 2 帧。
#-1
#0--2
$ gifsicle source.gif -d100 '#0-5' > output.gif
TODO: 目前修改似乎有问题,只导出了修改后的帧。
注意,单位是 1/100 秒,-d100 表示延迟时间为 1s。 在线工具 Ezgif GIF Maker。 Adding a delay to the end of an animated gif
注意,单位是 1/100 秒,-d100 表示延迟时间为 1s。
-d100
在线工具 Ezgif GIF Maker。
Adding a delay to the end of an animated gif
使用 FFmpeg
$ ffmpeg -vf "fps=10" -loop 0 target.gif -i source.mp4
convert source.png -rotate 90 target.png
想起再继续补充...
The text was updated successfully, but these errors were encountered:
No branches or pull requests
常用工具
查看 GIF 信息
Gifsicle
支持网络图片
详见 get_info.sh,它内部依赖 ImageMagick。
GIF 转换为 PNG
使用 ImageMagick
# 逐帧导出 $ convert source.gif target.png
如果 GIF 已经过透明度处理(即第一帧信息完整保留,后续帧仅保留变化的部分,未变的空间均为透明),可通过 Gifsicle 还原,再使用 ImageMagick 处理。
导出某帧
$ convert 'source.gif[0]' target.png
GIF 帧操作
简单抽帧
使用 macOS 内置的「预览」应用,可以快速插入/删除帧。打开 GIF 并在「菜单栏 - 显示」切换为「缩略清单」。
删除指定帧
修改帧与帧之间的 Delay Time
TODO: 目前修改似乎有问题,只导出了修改后的帧。
MP4 转 GIF
使用 FFmpeg
$ ffmpeg -vf "fps=10" -loop 0 target.gif -i source.mp4
图片旋转
使用 ImageMagick
想起再继续补充...
The text was updated successfully, but these errors were encountered: