Pixel Refiner

π Try it now: pixel-refiner.app
Pixel Refiner is a web-based tool that cleans up pixel art β especially AI-generated pixel art β and turns it into high-quality assets and icons. It removes anti-aliasing, auto-detects pixel grids, makes backgrounds transparent, and supports batch processing of multiple images β all running fast in the browser.
β¨ Features
AI-generated pixel art often comes with blurry edges (anti-aliasing artifacts), misaligned grids, and opaque backgrounds. Pixel Refiner fixes all of that.
- Anti-aliasing removal β Sharpens blurry edges back into clean, crisp pixels.
- Intelligent Grid Detection β Automatically detects the pixel grid size and resamples to the optimal resolution.
- Grid Candidate Selection β Displays multiple candidates for the best grid size; manually select the one that fits perfectly.
- Flexible Modes β Choose from Auto, Hint (Pixel + Auto), Force (Pixel only), or Off (1:1).
- High-Resolution Support β Enhanced accuracy for large images and complex pixel patterns.
- Fast estimation β A turbo mode for quick previews, even on large images.
- Smart background removal:
- Auto-transparency based on corner colors
- Eyedropper tool β Click to pick the exact background color
- Adjustable tolerance
- Interior hole filling (e.g. the inside of a donut shape)
- Isolated noise pixel cleanup
- Color reduction & palette mapping:
- Retro console palettes β NES, Game Boy, SNES, PC-9801, MSX1, PICO-8, and more.
- Custom quantization β High-quality color reduction using Oklab color space and K-means clustering.
- Dithering β Supports Floyd-Steinberg, Bayer (2x2, 4x4, 8x8), and Ordered dithering.
- Outline generation β Automatically adds an outline (stroke) to the sprite.
- Styles β Rounded (8-way) or Sharp (4-way).
- Custom color β Choose any color for the outline.
- Preset management β Save and load your favorite processing configurations to reuse them across different images.
- Auto trim β Strips transparent margins and crops to content bounds.
- Forced resize β Resizes to an exact pixel dimension you specify.
- Scaled export β Download at x2, x4, β¦ up to x32 for use in game engines and other tools.
- Multi-image processing:
- Batch upload β Drag and drop multiple files at once.
- Session management β Manage multiple images, remove unwanted ones, or clear all.
- Batch download β Process all images and download them as a single ZIP file.
- Batch scaling β Apply a specific scale factor to all images in the ZIP export.
- Non-blocking processing β Heavy image processing runs in a Web Worker so the UI stays responsive.
- Toast notifications β Real-time feedback for actions like saving presets or completing downloads.
π Usage
- Open the app (locally or on a deployed instance).
- Drag & drop images onto the drop zone (or click to browse). Multiple images are supported.
- Use the "Images" list to switch between uploaded images.
- Hit "Process" (or enable "Auto") to generate optimized pixel art sprites.
- Fine-tune settings as needed:
- Grid Detection β Mode selection (Auto/Hint/Force/Off), candidate selection, and fast mode toggle
- Colors & Palette β Preset selection, color count, dithering
- Background β Transparency mode (auto/manual), tolerance, cleanup options
- Outline β Add an outline to the sprite
- Use the "Compare" view to check the difference between the original and processed image with a slider.
- When you're happy with the result, click "Download" (use the βΌ dropdown to choose a scale factor).
- For multiple images, use "Download All (ZIP)" to export all processed sprites at once.
π οΈ Development
Built with TypeScript + Vite.
Prerequisites
- Node.js v18+
- npm
Setup
git clone https://github.com/HappyOnigiri/PixelRefiner.git
cd PixelRefiner
npm install
Dev server
npm run dev
Then open http://localhost:5173 in your browser.
Build
npm run build
Output goes to the dist directory.
Tests
Runs unit tests for the core image processing logic.
npm test
π Project Structure
src/browser/β Browser UI logic and main entry pointsrc/core/β Core image processing algorithms (grid detection, resampling, transparency, etc.)src/shared/β Type definitions and configuration constantstest/β Test code and fixture images
Note
Please note that this tool is designed primarily for automatic image conversion and optimization. Therefore, we do not plan to implement manual pixel-by-pixel editing features similar to paint software.
License
This project is licensed under the MIT License.