dongtu: Generating Animated GIFs in a Standardized Manner within an Agent

Introduction

When making presentations, writing documentation, or posting community content, you often need to bundle a set of screenshots, a video clip, or a screen recording into a GIF. Searching for Pillow, imageio, and FFmpeg parameters yourself and stitching together scripts involves scattered steps, and AI Agents can easily overlook details regarding frame rate, looping, or scaling. Below is an introduction to the SkillHub community Skill dongtu: it encapsulates workflows such as “image sequence to GIF,” “video clip to GIF,” and “screen recording to GIF” into a universal SKILL.md. Once installed, the Agent will follow this standardized set of instructions to execute tasks.

What is this

dongtu (Coordinates @user_fe9f5f41/jm-jsjkxyjs01-llx-146, current version 1.0.0) is a community-sourced (community) Skill published by user_fe9f5f41 on SkillHub. It is categorized under design-media, specifically in the subcategory Image Generation (design-image-gen). The core of the package is a SKILL.md named “GIF Animation Generation Skill,” which uses Python to convert image sequences, videos, or screen recordings into GIF animations. The tags indicate requires_api_key=false, meaning it does not rely on external API keys.

Official page and installation entry:

  • SkillHub: https://www.skillhub.cn/skills/user_fe9f5f41/jm-jsjkxyjs01-llx-146
  • Official URL: https://api.skillhub.cn/user_fe9f5f41/jm-jsjkxyjs01-llx-146

As of the page and scraped data, this Skill has approximately 778 downloads, a SkillHub rating of 100000, and an installation count of 0 (subject to SkillHub statistics).

Core Functions

The following content is derived from the SKILL.md (v1.0.0) within the Skill package. Once triggered, the Agent will operate according to the steps and code examples contained within.

Environment Dependencies

The Skill requires a local Python environment with the following installed:

pip install pillow imageio imageio-ffmpeg numpy

Video-related capabilities rely on imageio-ffmpeg; the documentation also provides examples for converting to GIF using the system ffmpeg command line (requires locally installed ffmpeg).

Image Sequence to GIF

Using Pillow: Reads multiple static images sorted by filename, writes out a GIF with save_all=True, and allows configuration of duration (milliseconds), loop (0 for infinite loop), optimize, etc. The documentation also provides an example of scaling a generated GIF proportionally using ImageSequence.Iterator.

Video to GIF

  • imageio: Uses iio.imiter to read video, extracts frames based on start second, duration, and fps, optionally scales via resize_width, and outputs using iio.imwrite.
  • FFmpeg: The documentation provides shell examples for clipping from a specified start point and setting fps and palette, suitable for scenarios prioritizing speed.

Screen Recording to GIF

The documentation provides an example based on pyautogui for capturing frames by region or full screen, and then writing to GIF using imageio. It notes that this is applicable to Windows; pip install pyautogui is required before use.

One-stop Command Line Script

SKILL.md contains a complete gif.py example: images mode merges multiple images, video mode clips segments from video, supporting parameters such as -d, -fps, -s, -t, --width, --loop. At the end of the documentation, there is a “Quick Reference” one-liner command example and a snippet for compressing GIFs using Pillow’s optimize.

Installation and Activation

First, confirm if the CLI is installed:

command -v skillhub && skillhub --version

If not installed, follow the SkillHub installation instructions (full installation example):

curl -fsSL https://skillhub-1388575217.cos.ap-guangzhou.myqcloud.com/install/install.sh | bash

When installing dongtu, you must use --dir to point to the current Agent’s skills directory; otherwise, it defaults to ./skills/, which may not be recognized. For example, the common path for Cursor is ~/.cursor/skills/:

skillhub install jm-jsjkxyjs01-llx-146 --namespace user_fe9f5f41 --dir ~/.cursor/skills/

For Claude Code, it is generally ~/.claude/skills/; for Codex, it is ~/.codex/skills/ or .agents/skills/ under the project. After installation, restart or refresh the Agent according to the client’s requirements to enable the Skill.

Method 2: Let AI Install via Official Prompt

The installation prompt provided on the SkillHub page is: According to https://skillhub.cn/install/skillhub.md, install @user_fe9f5f41/jm-jsjkxyjs01-llx-146. You can send this sentence to an Agent that supports Skills, and it will complete the CLI and --dir configuration according to the documentation.

Method 3: Download Zip

SkillHub provides a v1.0.0 Zip package download (found in the page sidebar under “Download Zip Package Installation”), with an address in the format of:

https://api.skillhub.cn/api/v1/download?slug=@user_fe9f5f41/jm-jsjkxyjs01-llx-146

After unzipping, place the Skill directory into the corresponding Agent’s skills path.

Typical Usage

After installation and activation, describe your requirements in the conversation (e.g., “Combine frames/*.png into a GIF with 200ms per frame” or “Clip 3 seconds starting from the 10th second of demo.mp4, width 480, 10fps”). The Agent should refer to SKILL.md to select the appropriate Pillow or imageio snippet.

Image Composition (Summary of basic documentation usage):

from PIL import Image
import glob

frames = []
for img_path in sorted(glob.glob("frames/frame_*.png")):
    frames.append(Image.open(img_path))

frames[0].save(
    "output.gif",
    save_all=True,
    append_images=frames[1:],
    duration=200,
    loop=0,
    optimize=True,
)

Video to GIF (Documentation example call):

video_to_gif("video.mp4", "output.gif", start_sec=10, duration_sec=3, fps=10, resize_width=480)

Command Line Script (Documentation example):

python gif.py images -i img1.png img2.png img3.jpg -o animation.gif -d 150 --width 640
python gif.py video -i demo.mp4 -o clip.gif -s 5 -t 4 -fps 12 --width 480

Actual paths, frame rates, and sizes depend on the files in your project; the Agent’s responsibility is to generate or adjust scripts based on the parameter tables and examples in the Skill, rather than replacing your local execution of pip / python / ffmpeg.

Use Cases and Notes

Who it is for: Developers or content creators who need to repeatedly create GIFs within Agents like Cursor or Claude Code; those who wish to fix Pillow / imageio / FFmpeg usage into reusable instructions to reduce the need to search documentation from scratch every time.

Limitations and Notes:

  1. The Skill is an operation guide and example code; it does not include pre-compiled binaries; the local machine must have Python and optionally ffmpeg, pyautogui installed.
  2. The screen recording example targets Windows + pyautogui; Linux/macOS users need to adapt to the corresponding screenshot solution themselves, which is not expanded upon in the Skill.
  3. For large GIFs, pay attention to optimize, quality, and resolution; the documentation provides scaling and compression references, but the output size still depends on the source material.
  4. The overview field on the SkillHub page is empty (hasOverview: false); the SKILL.md inside the package is the sole source of capability description.
  5. Community published, author not verified (isAuthorVerified: false); before use, you can check the security scan results on SkillHub and evaluate according to team standards.

Conclusion

dongtu consolidates common paths for GIF animation generation—multi-image composition, video clips, screen recording, and command-line encapsulation—into a single SKILL.md readable by Agents. It is categorized under image generation within design media and requires no API key. If you are already using SkillHub to manage Skills, you can use the CLI to install it to the correct --dir and directly describe your animation needs in your conversation.

Official SkillHub Page: https://www.skillhub.cn/skills/user_fe9f5f41/jm-jsjkxyjs01-llx-146

羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye