Sprite Animator: AI 像素艺术动画工具 - Openclaw Skills

作者:互联网

2026-03-30

AI教程

什么是 Sprite Animator?

Sprite Animator 是一款专为弥合静态图像与复古风格动画之间鸿沟而设计的工具。通过利用 nano-banana-pro (Gemini) 模型,该技能实现了逐帧绘制一致像素艺术这一复杂过程的自动化。它是 Openclaw Skills 中的佼佼者,因为其能够通过单次 AI 推理生成完整的 4x4 精灵表,从而保持风格连贯性,确保角色的形态和调色板在整个动画过程中保持稳定。

无论您是需要快速占位符的游戏开发者,还是追求低保真美学的数字艺术家,Sprite Animator 都能提供流线化的 CLI 工作流程来制作高质量 GIF。该工具处理从网格模板化到最终组装的所有环节,使其成为任何由 Openclaw Skills 驱动的创意工具包中必不可少的补充。

下载入口:https://github.com/openclaw/skills/tree/main/skills/awlevin/sprite-animator

安装与下载

1. ClawHub CLI

从源直接安装技能的最快方式。

npx clawhub@latest install sprite-animator

2. 手动安装

将技能文件夹复制到以下位置之一

全局模式 ~/.openclaw/skills/ 工作区 /skills/

优先级:工作区 > 本地 > 内置

3. 提示词安装

将此提示词复制到 OpenClaw 即可自动安装。

请帮我使用 Clawhub 安装 sprite-animator。如果尚未安装 Clawhub,请先安装(npm i -g clawhub)。

Sprite Animator 应用场景

  • 为社交媒体或社区个人资料创建自定义动画头像。
  • 为独立游戏开发项目快速制作角色动画原型。
  • 将个人照片或绘画转换为程式化的复古游戏素材。
  • 将概念设计图批量处理为功能性的 16 帧精灵表以供进一步编辑。
Sprite Animator 工作原理
  1. 工具生成一个由 16 个特定单元格组成的带标签 4x4 网格模板。
  2. 它将模板和您的源图像在单个请求中发送给 Gemini AI,以确保风格一致性。
  3. AI 根据请求的动画序列(待机、挥手、弹跳或跳舞)在网格中生成像素艺术帧。
  4. 系统从生成的精灵表中提取 16 个单独的帧。
  5. 帧经过处理并按照指定的持续时间和尺寸编译成循环动画 GIF。

Sprite Animator 配置指南

要使用此技能,请确保已安装 uv 软件包管理器并拥有有效的 Gemini API 密钥。配置您的环境并使用以下命令运行动画生成器:

# 设置您的 API 密钥
export GEMINI_API_KEY='your_gemini_api_key_here'

# 生成基础待机动画
uv run --with sprite-animator sprite-animator -i photo.png -o sprite.gif

# 生成特定动画(如“跳舞”)并设置更大的输出尺寸
uv run --with sprite-animator sprite-animator -i input.jpg -o animation.gif -a dance -s 256

Sprite Animator 数据架构与分类体系

Sprite Animator 通过清晰的基于文件的结构管理输入和输出数据。它可以选择保留中间资产供开发者使用:

文件类型 描述 用途
输入图像 PNG, JPG 或 JPEG 源文件 AI 的基础参考
输出 GIF 16 帧动画 GIF 最终交付成果
精灵表 4x4 PNG 网格 通过 --keep-sheet 生成用于手动编辑
帧 PNG 单个帧文件 通过 --keep-frames 生成用于动画分层
name: sprite-animator
description: Generate animated pixel art sprites from any image using AI. Send a photo, get a 16-frame animated GIF.
metadata:
  {
    "openclaw":
      {
        "emoji": "??",
        "requires": { "bins": ["uv"], "env": ["GEMINI_API_KEY"] },
        "primaryEnv": "GEMINI_API_KEY",
      },
  }

Sprite Animator

Generate animated pixel art sprites from any image. Uses nano-banana-pro (Gemini) to create a 16-frame sprite sheet in a single request, then assembles it into an animated GIF.

Quick Start

# Wave animation (default 16 frames)
uv run --with sprite-animator sprite-animator -i photo.png -o sprite.gif -a wave

# Bounce animation with larger sprites
uv run --with sprite-animator sprite-animator -i avatar.png -o bounce.gif -a bounce -s 256

# Keep the raw sprite sheet and individual frames
uv run --with sprite-animator sprite-animator -i pet.jpg -o dance.gif -a dance --keep-sheet --keep-frames

Animations

Type Description
idle Subtle breathing + blinking loop
wave Arm raises, waves back and forth, lowers
bounce Crouch → jump → land → recover
dance Lean, spin, jump — fun and energetic

Options

Flag Description
-i, --input Input image (photo, drawing, etc.)
-o, --output Output GIF path
-a, --animation Animation type: idle, wave, bounce, dance (default: idle)
-d, --duration Frame duration in ms (default: 100)
-s, --size Output sprite size in px (default: 128)
-r, --resolution Generation resolution: 1K or 2K (default: 1K)
--keep-sheet Save the raw sprite sheet
--keep-frames Save individual frame PNGs
-v, --verbose Verbose output

How It Works

  1. Creates a labeled 4x4 grid template (16 cells)
  2. Sends the template + source image to Gemini in ONE request
  3. AI fills each cell with a pixel art frame following the animation sequence
  4. Frames are extracted from the sheet and assembled into a looping GIF

Single-request generation ensures consistent style across all frames.

Source

https://github.com/Olafs-World/sprite-animator