Turn any image into hardware-accurate retro pixel art
bitmapped doesn’t just swap palettes — it reproduces the actual color limitations of real hardware. Palette quantization, spatial constraints, and display characteristics, all in a zero-dependency TypeScript library.
import { process } from 'bitmapped';
const result = process(imageData, {
blockSize: 4,
palette: preset.palette,
dithering: 'floyd-steinberg',
});
ctx.putImageData(result.imageData, 0, 0);Try it live
Pick a system preset and see the output update in real time:
Original
Game Boy (DMG)
Why bitmapped?
Not just palette swapping
Real retro hardware doesn’t let you use any color anywhere. The NES forces colors into 16×16 blocks. The ZX Spectrum locks brightness per 8×8 cell. bitmapped enforces these spatial constraints — that’s what makes the output look authentic.
Quick example
import { process } from 'bitmapped';
import { getPreset, enumerateColorSpace } from 'bitmapped/presets';
// Load a preset
const nes = getPreset('nes-ntsc');
// Process your image
const result = process(imageData, {
blockSize: 4,
palette: nes.palette,
dithering: 'floyd-steinberg',
distanceAlgorithm: 'redmean',
constraintType: nes.constraintType,
attributeBlockConfig: {
width: 16,
height: 16,
maxColors: 4,
},
});
// Render the result
ctx.putImageData(result.imageData, 0, 0);System presets
NES
256×240
25 of 54 colors
16×16 attribute blocks
Game Boy
160×144
4 of 4 colors
4 green shades
ZX Spectrum
256×192
15 of 15 colors
8×8 attribute clash
SNES
256×224
256 of 32768 colors
Per-tile palette
Genesis
320×224
61 of 512 colors
9-bit RGB, nonlinear DAC
Commodore 64
320×200
16 of 16 colors
Hires / multicolor modes
Apple II
280×192
6 of 6 colors
NTSC artifact colors
Amiga
320×256
4096 of 4096 colors
Hold-And-Modify
PlayStation 1
320×240
32768 of 32768 colors
15-bit + ordered dither
Atari 2600
160×192
4 of 128 colors
4 colors per scanline
GBA
240×160
32768 of 32768 colors
15-bit RGB direct
Master System
256×192
32 of 64 colors
Per-tile palette
Neo Geo
320×224
4096 of 65536 colors
16-bit color, 256 palettes
Game Gear
160×144
32 of 4096 colors
12-bit RGB
Get started
Install bitmapped and convert your first image in under 5 minutes.
npm install bitmappedLast updated on