Pixel Art Editor
Create pixel art with brush, fill, line and mirror tools. Export your 8-bit creations as SVG, HTML, or PNG. Free online editor.
About
Pixel art operates on a constrained grid where each cell maps to exactly one color value. Errors in sprite design compound at scale: a single misplaced pixel in a 16×16 tile becomes 4 misplaced pixels at 2× zoom and 16 at 4×. This editor implements Bresenham's line algorithm for sub-pixel accuracy and iterative BFS flood fill to prevent stack overflow on grids up to 64×64. Export produces clean SVG with one <rect> per opaque pixel or a semantic HTML grid. Note: PNG export rasterizes at the canvas resolution. For print work above 300 DPI, use the SVG output.
Formulas
Bresenham's line algorithm determines which pixels to illuminate between two endpoints on the grid. Given start point (x0, y0) and end point (x1, y1):
At each step, the error term err determines whether to advance in x, y, or both. The algorithm runs in O(max(dx, |dy|)) time with zero floating-point operations.
Flood fill uses iterative breadth-first search. A queue holds coordinate pairs. For each dequeued pixel, if its color matches the target color and differs from the replacement color, it is painted and its 4 cardinal neighbors are enqueued. Worst case fills W × H pixels in O(W ⋅ H) time.
Where W = grid width in pixels, H = grid height in pixels, dx = horizontal distance, dy = vertical distance, err = accumulated error term.
Reference Data
| Grid Size | Total Pixels | Common Use | SVG File Size (approx.) | Recommended Palette |
|---|---|---|---|---|
| 8×8 | 64 | Micro icons, favicons | 2 - 4 KB | 4 colors |
| 16×16 | 256 | Game sprites, emoji | 8 - 15 KB | 8 - 16 colors |
| 24×24 | 576 | UI icons, avatars | 15 - 30 KB | 16 colors |
| 32×32 | 1024 | RPG sprites, tiles | 25 - 55 KB | 16 - 32 colors |
| 48×48 | 2304 | Detailed characters | 50 - 120 KB | 32 colors |
| 64×64 | 4096 | Portraits, scenes | 100 - 250 KB | 32 - 64 colors |
| Classic Palettes | ||||
| Game Boy | 4 shades of green | #0f380f, #306230, #8bac0f, #9bbc0f | ||
| NES | 54 colors (hardware) | 6-bit RGB, 4 palettes per sprite | ||
| CGA | 4 colors per mode | Palette 0: black, cyan, magenta, white | ||
| PICO-8 | 16 fixed colors | Modern retro standard | ||
| Commodore 64 | 16 colors | Fixed hardware palette | ||
| Sega Master | 64 colors (6-bit) | Up to 32 on screen | ||