gif-maker

Original🇨🇳 Chinese
Translated
2 scripts

Convert sequence frame images or Sprite Sheets into high-quality GIF animations. Supports custom FPS, layout splitting, and loop playback.

3installs
Added on

NPX Install

npx skill4agent add guanyang/super-publisher gif-maker

SKILL.md Content (Chinese)

View Translation Comparison →

GIF Maker

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

  • 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
    --max-size
    parameter, automatically adjusting compression parameters to meet size limits of platforms like WeChat stickers.
  • Parameter Control:
    • --fps
      : Specify frames per second (default is 12).
    • --layout
      : Specify the Sprite Sheet layout (e.g.,
      4x4
      ), only required in this mode.
    • --loop
      : Loops infinitely by default.
    • --max-size
      : Specify maximum file size (KB).

Usage Guide

1. Quick Start

No need to manually install dependencies; just run the script directly. The tool will automatically create a virtual environment (
.venv
) and install the required dependencies.
bash
# Basic Usage 1: Read sequence frames from a folder
./skills/gif-maker/scripts/run.sh /path/to/frame_folder --output my_anim.gif

# 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

# Common Options:
# - Specify FPS (e.g., 24)
./skills/gif-maker/scripts/run.sh /path/to/folder --fps 24

# - Enable auto-compression (limit file size to 950KB)
./skills/gif-maker/scripts/run.sh /path/to/folder --max-size 950

2. (Optional) Manual Installation

If you prefer to manage the environment manually (Note: The compression feature depends on the
gifsicle
tool; please ensure it is installed on your system):
  • 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
    : Input path. Can be a folder containing images or a single image file.
  • --output
    (
    -o
    ): Output GIF file name, default is
    output.gif
    .
  • --fps
    : Frames per second, default is 12.
  • --layout
    : Only used when
    source
    is a single file, format is
    rowsxcolumns
    (e.g.,
    4x4
    ).
  • --max-size
    : (Optional) Enable GIF compression, specify the maximum target file size (KB). Compression is only attempted if the original file exceeds this size.

Examples

Suppose you have a folder
frames/
containing
01.png
,
02.png
...
10.png
:
bash
./skills/gif-maker/scripts/run.sh frames/ -o animation.gif --fps 15
Suppose you have a
sheet.png
which is a 4x4 action sequence, and you need to generate a GIF that meets WeChat sticker specifications (<1MB):
bash
./skills/gif-maker/scripts/run.sh sheet.png --layout 4x4 -o action.gif --max-size 950