jenissimo/unfake.js

Fix AI pixel art and vector images right in your browser

What it solves

AI-generated images, particularly pixel art, often suffer from inconsistent pixel sizes, color bleeding, and artifacts. This library provides tools to clean up these images and convert them into usable, professional-grade assets by correcting their scale and simplifying their color palettes.

How it works

The project uses a Rust-based core (unfake-core) compiled to WebAssembly for high-performance image processing. It operates in two primary modes:

  1. Pixel Art Processor: It automatically detects the "true" pixel size of an upscaled image, downscales it using content-aware methods (like dominant or median), snaps the image to a grid, and uses imagequant for color quantization to reduce the palette.
  2. Image Vectorizer: It acts as an intelligent wrapper around imagetracer.js, applying pre-processing filters (like Bilateral or Median blur) and color quantization before converting raster images into scalable SVG files.

Who it’s for

Digital artists, game developers, and AI artists who need to reach a final, clean version of an AI-generated image for use in games or design projects.

Highlights

  • Intelligent Scale Detection: Automatically identifies the native scale of upscaled pixel art.
  • Content-Aware Downscaling: Reduces images to 1x scale without introducing blurriness.
  • WASM Core: High-performance processing powered by Rust.
  • Integrated Browser Tool: A feature-rich interactive interface for real-time adjustments and side-by-side comparisons.
  • Vectorization Pipeline: A complete workflow for converting raster images to clean SVGs with noise reduction and palette extraction.