Skip to content

Repository files navigation

Spripe Logo

An Open-Source AI-Powered Asset & Sprite Generation Pipeline

Python PyQt6 OpenCV Rembg NumPy


spripe is an end-to-end open-source toolkit designed to rapidly generate, process, normalize, and polish 2D sprites from video files. Built specifically for game developers and animators, it takes raw gameplay or animation videos and transforms them into game-ready, perfectly aligned transparent PNG sequences using advanced AI background removal.

✨ Features

  • 🤖 AI Background Extraction: Feed it an .mp4 or a folder of PNGs, and Spripe uses rembg (U-Net based neural networks) to isolate the character, regardless of complex backgrounds, shadows, or gradients. Video processing runs entirely in a background QThread to keep the UI perfectly responsive.
  • 📐 Automatic Normalization: Characters are automatically scaled to a consistent height and their feet are aligned to a standard baseline, ensuring fluid continuous animation transitions (e.g., from idle to jump).
  • 🎨 Advanced GUI Editor: Includes a built-in PyQt6 painting environment tailored for sprite cleanup:
    • GrabCut Quick Selection: Drag a box, and OpenCV AI seamlessly cuts out artifacts.
    • Magic Wand & Lassos: Select regions with adjustable tolerances and morphological contour smoothing.
    • Non-Destructive Workflows: Easily paint, erase alpha channels, soft-brush, and eyedrop directly over your frames. Full Ctrl+Z Undo and Ctrl+Y Redo command history is supported.
    • 📌 Pinned Keyframe (Onion Skinning): Pin any frame as a transparent overlay to perfectly align and compare positioning across different animations!
  • 🎞️ Timeline & Playback: Manage your frames in a dedicated timeline. Drag-and-drop to reorder, delete multiple frames at once, preview animations in real-time at 12 FPS, or toggle "Boomerang" mode. You can also right-click frames or press M to instantly Mark to Fix, letting you easily track which frames need more polish without any UI freezing.
  • 🗂️ Project Workspace: Robust hierarchical organization (Projects -> Assets -> Animations). Effortlessly manage multiple characters and their movesets with full right-click context menu support. The Asset Dashboard also automatically refreshes file sizes instantly after compression.
  • 📦 Export System: Instantly export single animations or entire assets into engine-ready structured folders, .gif files with customizable frame rates, or ZIP archives. Godot engine users can natively adjust export PNG compression levels.
  • 🔄 Background Task Indicator: All long-running processes (Normalization, GIF export, Extraction) are tracked seamlessly via an animated spinner in the status bar so you always know what Spripe is doing behind the scenes.
  • 🧠 Prompt Template Manager: Manage your generative AI prompts through structured dictionaries and native clipboard integrations.

🛠️ The Workflow

Spripe simplifies sprite generation into a highly automated 4-step process:

  1. Import: Use File > New Project or File > Open Project to load a lightweight .spripe file or directory. Then import your source .mp4 files or PNG sequences.
  2. AI Generation (sequence_worker.py): The engine processes the video in the background, extracting frames at your desired FPS and stripping the background using AI. Results go to out_{vidname}.
  3. Normalize (normalize_animations.py): Run the normalizer (via the Pipeline Controls or right-click context menu) to scale the character and align their feet onto a unified 16:9 canvas space. Results go to normalized_output/.
  4. Polish & Export (GUI): Open the Spripe GUI to manually review the sequence. Use the timeline to tag or delete bad frames, drag-and-drop to fix ordering, and use the Painter tools to erase lingering background artifacts. Finally, use File > Save Project As... to export your entire polished project into a compressed .spripepack archive, or export individual sequences!

🚀 Installation & Setup

Spripe is now a fully installable Python package!

  1. Clone this repository.

  2. Navigate to the project directory and install it via pip. You can choose whether you want the CPU or GPU version for AI background removal:

    For CPU processing:

    pip install -e .[cpu]

    For GPU processing (NVIDIA/CUDA - Much Faster):

    pip install -e .[gpu]

Alternatively, you can build a standalone Windows executable by running python build_exe.py.

🎮 How to Use

1. Launching the GUI

The easiest way to use Spripe is through its visual interface. It acts as a control center for the entire pipeline. Once installed, simply type:

spripe gui
# or just
spripe

From the GUI, you can:

  • Organize: Use File > Open Project to read projects externally or copy them to your workspace. Quickly switch projects via File > Recent Projects. Use the Asset Browser to manage them.
  • Process: Trigger the AI Processing and Normalization scripts seamlessly in the background.
  • Edit: Preview and manually paint/edit frames. Use the "Pin Frame" feature to check alignments.
  • Export: Use File > Save Project As... to backup to a .spripepack, or right-click any Asset/Animation to export into an engine-ready ZIP.

2. Command Line Processing

If you prefer batch processing or terminal workflows, you can run the core scripts directly via the spripe CLI.

Extract frames and remove background:

spripe process --video .\videos\idle.mp4 --out .\raw_output\

Normalize Scale and Position:

spripe normalize --project MyGame --asset Ninja
# Or by path
spripe normalize --path .\raw_output\idle

Fix Frame Numbering or Reverse: If you manually delete files via the file explorer, you can fix the numbering gaps or reverse them:

spripe rename --path .\raw_output\idle
spripe reverse --path .\raw_output\idle

🤝 Contributing

Contributions, issues, and feature requests are welcome! Feel free to check the issues page.

📝 License

This project is open-source and available under the MIT License.

About

Open-source AI sprite editor with video-to-sprite generation, cleanup, normalization, and frame editing.

Topics

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages