How the pixel editor works

The editor is a static page. Each frame is an array of N×N colors, where N is 16, 32, or 64. A transparent cell is stored empty and stays empty in a PNG or in the CSS snippet.

Pointer and touch use the same coordinates. Changing the canvas size keeps pixels in the top-left and pads or crops the rest. Nothing is posted to a server.

Drawing tools

Brush

The brush paints the active color onto the pixel under the pointer. If a mirror toggle is on, the same stroke is copied across the axis.

Eraser

The eraser writes a transparent pixel. Mirrored erasing follows the same axes as the brush.

Paint bucket

The paint bucket runs a 4-way iterative flood fill (up, down, left, right). It does not fill diagonally, and it does not recurse, so a 64×64 fill stays safe.

Eyedropper

The eyedropper reads the pixel under the pointer. An opaque color becomes the active color and returns you to the brush. A transparent pixel switches to the eraser.

Mirrors, undo, and size

Horizontal and vertical mirrors can be on at the same time. A point (x, y) on a canvas of size N also paints (N − 1 − x, y), (x, N − 1 − y), or both.

Undo and redo keep up to 30 document snapshots, including frame counts and canvas size. That is a hard cap; older steps are dropped.

Frames and onion skin

You can hold up to eight frames. Add a blank frame, duplicate the current one, or delete a frame (the last remaining frame cannot be removed).

Onion skin draws the previous frame at a lower opacity under the current frame so you can line up a walk cycle. The preview plays at 1–24 frames per second and can be paused.

Local exports

PNG export renders the current frame on a transparent canvas at 1×, 8×, or 16× and downloads it here. A sprite sheet places every frame side by side on one transparent PNG; width is frames × size × scale, height is size × scale.

The CSS export is a copyable snippet: width: 1px; height: 1px; box-shadow: … for each opaque pixel. Transparent pixels are omitted. The file never leaves this device.

Back to the editor

Questions

Why is flood fill 4-way, not 8-way?

A 4-way fill matches the usual pixel-art bucket: it stops at a diagonal corner instead of leaking through it. The fill is iterative, so a full 64×64 canvas does not depend on call-stack depth.

Does changing size undo?

Yes. A size change is a document snapshot, so undo can restore the previous size and pixels, within the 30-step cap.