gif-maker
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseGIF 动画生成器 (GIF Maker)
GIF Maker
本 Skill 旨在帮助用户快速将一组序列帧图片或单张精灵表(Sprite Sheet)转换为 GIF 动画。
This Skill is designed to help users quickly convert a set of sequence frame images or a single Sprite Sheet into a GIF animation.
核心功能
Core Features
- 序列帧转 GIF:支持读取文件夹内的 ,
png序列,按文件名排序合成 GIF。jpg - 精灵表转 GIF:支持读取单张 Grid 图片(如 4x4 精灵表),自动切分并合成为 GIF。
- 智能压缩:支持通过 参数指定目标文件大小(如 950KB),自动调整压缩参数以满足微信表情包等平台的体积限制。
--max-size - 参数控制:
- :指定每秒帧数(默认为 12)。
--fps - :指定精灵表布局(如
--layout),仅在这个模式下需要。4x4 - :默认永久循环。
--loop - : 指定最大体积 (KB)。
--max-size
- Sequence Frames to GIF: Supports reading png, jpg sequences in a folder, sorting them by file name and combining into a GIF.
- Sprite Sheet to GIF: Supports reading a single Grid image (e.g., 4x4 Sprite Sheet), automatically splitting it and combining into a GIF.
- Smart Compression: Supports specifying the target file size (e.g., 950KB) via the parameter, automatically adjusting compression parameters to meet size limits of platforms like WeChat stickers.
--max-size - Parameter Control:
- : Specify frames per second (default is 12).
--fps - : Specify the Sprite Sheet layout (e.g.,
--layout), only required in this mode.4x4 - : Loops infinitely by default.
--loop - : Specify maximum file size (KB).
--max-size
使用指南
Usage Guide
1. 快速开始
1. Quick Start
无需手动安装依赖,直接运行脚本即可。工具会自动创建虚拟环境 () 并安装所需依赖。
.venvbash
undefinedNo need to manually install dependencies; just run the script directly. The tool will automatically create a virtual environment () and install the required dependencies.
.venvbash
undefined基本用法 1:从文件夹读取序列帧
Basic Usage 1: Read sequence frames from a folder
./skills/gif-maker/scripts/run.sh /path/to/frame_folder --output my_anim.gif
./skills/gif-maker/scripts/run.sh /path/to/frame_folder --output my_anim.gif
基本用法 2:从单张精灵表生成 (需要指定布局)
Basic Usage 2: Generate from a single Sprite Sheet (layout required)
./skills/gif-maker/scripts/run.sh /path/to/sheet.png --layout 4x4 --output my_sheet_anim.gif
./skills/gif-maker/scripts/run.sh /path/to/sheet.png --layout 4x4 --output my_sheet_anim.gif
常用选项:
Common Options:
- 指定 FPS (例如 24)
- Specify FPS (e.g., 24)
./skills/gif-maker/scripts/run.sh /path/to/folder --fps 24
./skills/gif-maker/scripts/run.sh /path/to/folder --fps 24
- 开启自动压缩 (限制文件大小在 950KB 以内)
- Enable auto-compression (limit file size to 950KB)
./skills/gif-maker/scripts/run.sh /path/to/folder --max-size 950
undefined./skills/gif-maker/scripts/run.sh /path/to/folder --max-size 950
undefined2. (可选) 手动安装
2. (Optional) Manual Installation
如果您希望手动管理环境(注意:压缩功能依赖 工具,请确保系统已安装):
gifsicle- macOS:
brew install gifsicle - Ubuntu:
sudo apt-get install gifsicle
bash
python3 -m venv skills/gif-maker/.venv
source skills/gif-maker/.venv/bin/activate
pip install -r skills/gif-maker/requirements.txt
python3 skills/gif-maker/scripts/make_gif.py ...If you prefer to manage the environment manually (Note: The compression feature depends on the tool; please ensure it is installed on your system):
gifsicle- macOS:
brew install gifsicle - Ubuntu:
sudo apt-get install gifsicle
bash
python3 -m venv skills/gif-maker/.venv
source skills/gif-maker/.venv/bin/activate
pip install -r skills/gif-maker/requirements.txt
python3 skills/gif-maker/scripts/make_gif.py ...参数说明
Parameter Description
- : 输入路径。可以是包含图片的文件夹,也可以是单张图片文件。
source - (
--output): 输出 GIF 文件名,默认为-o。output.gif - : 帧率,默认为 12。
--fps - : 仅当
--layout为单文件时使用,格式为source(如行数x列数)。4x4 - : (可选) 启用 GIF 压缩,指定目标文件最大大小 (KB)。仅当原始文件超过此大小时才会尝试压缩。
--max-size
- : Input path. Can be a folder containing images or a single image file.
source - (
--output): Output GIF file name, default is-o.output.gif - : Frames per second, default is 12.
--fps - : Only used when
--layoutis a single file, format issource(e.g.,rowsxcolumns).4x4 - : (Optional) Enable GIF compression, specify the maximum target file size (KB). Compression is only attempted if the original file exceeds this size.
--max-size
示例
Examples
假设你有一个文件夹 包含 , ... :
frames/01.png02.png10.pngbash
./skills/gif-maker/scripts/run.sh frames/ -o animation.gif --fps 15假设你有一张 是 4x4 的动作序列,且需要生成符合微信表情包规范(<1MB)的 GIF:
sheet.pngbash
./skills/gif-maker/scripts/run.sh sheet.png --layout 4x4 -o action.gif --max-size 950Suppose you have a folder containing , ... :
frames/01.png02.png10.pngbash
./skills/gif-maker/scripts/run.sh frames/ -o animation.gif --fps 15Suppose you have a which is a 4x4 action sequence, and you need to generate a GIF that meets WeChat sticker specifications (<1MB):
sheet.pngbash
./skills/gif-maker/scripts/run.sh sheet.png --layout 4x4 -o action.gif --max-size 950