X PixMap
Reusable XPM
Demos
Click a scene to edit it. Drag a scene into the Viewer to load it.
Live output
Select 2.5D to extrude the flat XPM, then drag the Viewer to orbit it.
2D: draw waves on the left; predicted bottom caustics are on the right. In 2.5D, auto-orbit keeps running while you draw on the water.
Drag to orbit · Double-click for front
The plaid demo is the example from the XPM manual.
Why this exists
XPM stores pixel art as plain text, making every image readable, diffable, and easy to embed in source code. This workbench brings the X PixMap specification.
XPM format—used for icons and interface graphics in the X Window System, with images stored as plain text that could even be embedded directly in C source code. I thought that was really cool.
Edit an XPM directly, inspect the live output, and export the result without sending the source anywhere.
Format basics
Start with ! XPM2. Lines beginning with ! are comments.
! XPM2
!
Define the image with width height colors chars-per-pixel. For example, 10 10 3 1.
width height colors chars-per-pixel
10 10 3 1
Add exactly that many color lines, such as X c black or . c None.
X c black
. c None
Write one pixel row per image row. Each row must contain width × chars-per-pixel characters.
width × chars-per-pixel
Adding a color? Add its definition, increase the header’s color count, then use its symbol in the pixel rows. In this editor, documents with ! colors and ! pixels markers are kept in sync automatically.
! colors
! pixels
For a spherical 2.5D asset, add ! xpm-workbench primitive sphere. The opaque XPM mask supplies the sphere’s material, cached concentric slices build its volume, and the Depth control sets its Z diameter.
! xpm-workbench primitive sphere
The Impostor (2 XPM) sphere packs two orthogonal views into one XPM atlas. In 2.5D mode, the renderer reconstructs both slice stacks and favors the one that is most face-on, avoiding the single stack’s edge-on failure. The thickness control changes the shared Z extent: it expands the first stack through its slices and the rotated stack across its in-plane Z axis. Both views keep the same camera-space shading throughout a full orbit.
Import STL accepts binary or ASCII meshes, including OpenSCAD exports. It slices the solid locally in your browser and packs the cross-sections into a portable XPM atlas; the slice-size, slice-count, and slice-layout comments reconstruct its 2.5D volume.
slice-size
slice-count
slice-layout
smol plate class: switches one indexed micro-scene among a temperate garden, ice, cactus desert, red-dwarf biome, and K-star biome. Each surface carries its own terrain, vegetation, and star-colored lighting; the red-dwarf grass sways in clustered waves. In 2.5D mode, Export RFL sprites captures a 4×4 octahedral direction field, a half-resolution medium field, and one tiny far silhouette. RFL treats every coarse heightmap texel as a 32×32 detail-voxel patch and uses two crossed XPM planes nearby. Grass pond uses the same grass layer around an irregular indexed-water boundary. Central grass pool expands the meadow and keeps a smaller, irregularly round water section in its center.
2.5D caustic water runs the Godot height-field update in two floating-point buffers. The same field deforms the translucent water mesh, refracts an indexed rocky bed, casts moving caustics, and controls angle-dependent Fresnel reflection. The 2D view places the clickable heightfield beside its selected-bottom caustic prediction at the selected depth. During 2.5D auto-orbit, draw directly on the projected water without stopping the camera. Bottom materials remain indexed surfaces, and the logarithmic gravity control runs from lunar ⅙g through centered 1g to 6g. The bottom-vegetation XPM directive selects clover clusters, short grass strands, tall grass, or a bare surface in both views. Water area presets expand the simulation from the original 64 × 64 field up to 128 × 128. Light angle turns the fixed-height source around the scene; source color and intensity control the surface highlight, bottom shading, and caustic energy together. Caustics use sparse image-space photon projection, neighboring path reuse, a small gather blur, and temporal reuse between frames. The detail menu trades photon spacing and mesh density for speed while keeping additive light luminous across differently colored bottoms. The water volume uses liquid refraction, color, dispersion, and absorption controls, plus adjustable surface opacity and damping from 10 to 50. Liquid metal makes the surface opaque and reflective while disabling the underwater caustic layer. Caustics soften beyond 20 px and disappear at 25 px in ordinary liquid mode. Export XPM saves the current water frame, while Export 4×4 atlas saves sixteen frames in one genuine XPM.