Layered Sprite Baker Tool

Project information

  • Category: Unity Tools, Editor Scripts, Editor GUI Shaders
  • Project date: May, 2025

Layered Sprite Baker Tool

A fully-featured image compositing editor built directly into Unity. This tool enables artists and designers to combine multiple image layers with control over tinting, masking, offsetting, and scaling—all within a non-destructive workflow. Designed for banner creation, procedural VFX generation, and AI-driven asset pipelines, it supports both manual editing and large-scale JSON batch processing.

Why I Built This

Unity lacks an intuitive, scalable way to blend and manipulate multiple sprites for layered compositing. I needed a tool that allowed procedural assembly of UI art, banners, and visual noise textures—something that could be driven by AI or script but also empower designers to work visually in the editor. This tool bridges that gap.

The custom inspector is artist-friendly, fast, and fully supports real-time preview, saving out both the final PNGs and the JSON definitions used to recreate them. Designers can tweak layers and bake immediately, while technical pipelines can use the batcher to mass-generate assets from JSON configurations.

How It Works

  • Layer System: Add unlimited image layers, each with independent controls for tint, scale, position, and mask state.
  • Real-Time Preview: Every adjustment reflects instantly in the editor using a GPU-based compositing preview.
  • Masking System: Any layer can be toggled as a mask, affecting layers below it with alpha multiplication.
  • Bake and Save: Export the composited result as a PNG and optionally save the configuration as a JSON file.
  • JSON Batcher: Select multiple JSON files, hit one button, and mass bake output images for AI pipelines or asset packs.

Tech Highlights

  • Fully custom Unity editor UI with drag-and-drop, color pickers, masking toggles, and parameter sliders.
  • Layered GPU-based blending—no texture read/write required for previews.
  • Support for JSON import/export with auto-refresh for iterative workflows and external data sources (e.g., AI tools).
  • Non-destructive pipeline—layers remain editable after baking.
  • Supports high-resolution baking with configurable output size fields.

What I Learned

1. Tool Usability Matters: Even the most powerful tools fall short if artists can't understand them in 10 seconds. I kept the UI flat, simple, and responsive.

2. Batch Workflows Require Discipline: Baking 50+ AI-generated assets in a single click meant creating a predictable, error-tolerant JSON parser and asset resolver.

3. Editor GPU Previews Scale Beautifully: I avoided using CPU-read pixels by building everything around RenderTextures and draw calls, keeping previews fast even with large layers.

4. Reusability is Critical: This tool now serves as a core piece of my asset generation pipeline across multiple projects—anything that needs fast, layered art now runs through it.