A tool to snap pixels to a perfect grid. Designed to fix messy and inconsistent pixel art generated by AI.
A tool to snap pixels to a perfect grid. Designed to fix messy and inconsistent pixel art generated by AI.
A tool to snap pixels to a perfect grid. Designed to fix messy and inconsistent pixel art generated by AI.
Current AI image models can't understand grid-based pixel art.
With Pixel Snapper:
Pixel Snapper preserves as much details as possible like dithering.
brew install Hugo-Dz/tap/spritefusion-pixel-snapperInstallation with Cargo requires Rust. Once installed, the CLI runs as a standalone native binary.
cargo install spritefusion-pixel-snapperspritefusion-pixel-snapper <INPUT> <OUTPUT> [COLOR_COUNT] [OPTIONS]<INPUT>: A PNG/JPEG image, or a directory for batch processing.<OUTPUT>: An output PNG, or a different output directory for a batch.[COLOR_COUNT]: Number of palette colors. Defaults to 16.--pixel-size <PIXELS>: Overrides the auto-detected pixel size. The value must be between 1 and half the smallest image dimension.--palette <HEX,...>: Constrains the output to comma-separated six-digit hex colors.Examples:
…Run spritefusion-pixel-snapper --help to see every option.
git clone https://github.com/Hugo-Dz/spritefusion-pixel-snapper.git
cd spritefusion-pixel-snapper
cargo build --releaseThe binary will be available at target/release/spritefusion-pixel-snapper.
git clone https://github.com/Hugo-Dz/spritefusion-pixel-snapper.git
cd spritefusion-pixel-snapperBuild the WASM module:
wasm-pack build --target web --out-dir pkg --releaseThen use the WASM module in your project:
import init, { process_image } from "./pkg/spritefusion_pixel_snapper.js";
await init();
// process_image(inputBytes, kColors?, pixelSizeOverride?, paletteHex?)
const outputBytes = process_image(inputBytes, 16);
// With a custom palette
const recoloredBytes = process_image(inputBytes, null, null, "0f0f1b,ffecd6,ff4d6d,29adff");Pass null for any optional argument you want to leave on its default behavior.
Pixel Snapper is a Sprite Fusion project. Sprite Fusion is a tool to generate TRUE pixel art sprites and animations for game development.
MIT License Hugo Duprez
No open issues yet, or sync has not completed.