MCPcopy Index your code
hub / github.com/Hugo-Dz/spritefusion-pixel-snapper

github.com/Hugo-Dz/spritefusion-pixel-snapper @main

Chat with this repo
repository ↗ · DeepWiki ↗ · + Follow
35 symbols 64 edges 1 files 1 documented · 3%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Sprite Fusion Pixel Snapper

  • Online version: https://spritefusion.com/pixel-snapper
  • Desktop version: https://www.spritefusion.com/pixel-snapper#desktop-edition

A tool to snap pixels to a perfect grid. Designed to fix messy and inconsistent pixel art generated by AI.

Pixel Snapper

Why ?

Current AI image models can't understand grid-based pixel art.

  • Pixel are inconsistent in size and position.
  • The grid resolution can drift over time.
  • Colors are not tied to a strict palette.

With Pixel Snapper:

  • ✅ Pixel are snapped to a perfect grid.
  • ✅ The grid resolution is consistent and can be scaled to pixel resolution.
  • ✅ Colors are tied to a strict, quantized palette.

Perfect for

  • AI generated pixel art that needs to be snapped to a grid.
  • Procedural 2D art that doesn't fit a grid like tilemaps or isometric maps.
  • 2D game assets and 3D textures that need to be perfectly scalable.

Details

Pixel Snapper preserves as much details as possible like dithering.

Desktop Application

Desktop

A standalone build of Pixel Snapper coming with these features:

  • Fast batch processing
  • 100% offline desktop app
  • One-time purchase, yours forever!
  • Free lifetime updates
  • Works on Mac, Linux, and Windows

Download the desktop application

Build from source

Requires Rust installed on your machine.

💻 CLI

git clone https://github.com/Hugo-Dz/spritefusion-pixel-snapper.git
cd spritefusion-pixel-snapper
cargo run input.png output.png

The command accepts an optional k-colors argument:

cargo run input.png output.png 16

Use a directory as the input path to process a batch.

cargo run sprites/batch_inputs sprites/batch_outputs 16

You can also override the auto-detected pixel size with --pixel-size:

cargo run input.png output.png --pixel-size 8
cargo run sprites/batch_inputs sprites/batch_outputs 16 --pixel-size 8

This is useful when the auto-detection doesn't match the expected grid size. The value must be between 1 and half the smallest image dimension.

🌐 Web (WASM)

git clone https://github.com/Hugo-Dz/spritefusion-pixel-snapper.git
cd spritefusion-pixel-snapper

Build the WASM module:

wasm-pack build --target web --out-dir pkg --release

Then use the WASM module in your project:

import init, { process_image } from "./pkg/spritefusion_pixel_snapper.js";

await init();

// process_image(inputBytes, kColors?, pixelSizeOverride?)
const outputBytes = process_image(inputBytes, 16);

Pass null for any optional argument you want to leave on its default behavior.

Acknowledgments

Pixel Snapper is a Sprite Fusion project. Sprite Fusion is a tool to generate TRUE pixel art sprites and animations for game development.

Sprite Fusion Pixel Art Generator

License

MIT License Hugo Duprez

Core symbols most depended-on inside this repo

dist_sq
called by 4
src/main.rs
snap_uniform_cuts
called by 3
src/main.rs
process_image_common
called by 2
src/main.rs
process_file
called by 2
src/main.rs
sample_index
called by 2
src/main.rs
estimate_step_size
called by 2
src/main.rs
walk
called by 2
src/main.rs
stabilize_cuts
called by 2
src/main.rs

Shape

Function 27
Class 3
Method 3
Enum 2

Languages

Rust100%

Modules by API surface

src/main.rs35 symbols

For agents

$ claude mcp add spritefusion-pixel-snapper \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact