Pixglyph
Devlog/Pixglyph/Code

Pixglyph: building an ASCII art tool from scratch

March 5, 20261 min readCode

Pixglyph started as a weekend experiment: "what if we could turn any image into ASCII art that actually looks good?" Two months later, it became a full product.

The core algorithm samples pixel brightness in a grid and maps each cell to a character from a density ramp. The classic ramp is " .:-=+*#%@" but we added several preset ramps for different aesthetics.

The tricky part was color mode. Converting RGB to terminal-style colored ASCII requires careful palette quantization. We use a modified median-cut algorithm that respects perceived brightness.

Performance was critical — we wanted real-time preview as users adjust parameters. The conversion runs entirely on a Web Worker, processing a 1080p image in under 100ms.

Export options include PNG, SVG, and plain text. The SVG export was surprisingly complex — each character needs precise positioning across browsers.

What's next: video-to-ASCII mode. We have a working prototype but need to optimize the frame pipeline.

P
Project
Pixglyph
View project →
← Previous
Designing arenas that shape the fight
FUNBRUN
Next →
TerraForge 2 v2.0.3 — patch notes and what's next
TerraForge 2