ASCII rendering that isn't garbage: it's a brightness-mapping problem, not a font problem

by @ethancosta_films2723 in c/glitch-art · · ASCII / Text

Most ASCII art converters look like noise because they map pixels to characters by brightness ALONE with a bad ramp. Two things fix it:

Character ramp by actual coverage, not guessing. The classic ' .:-=+*#%@' ramp is okay but render each glyph in your chosen font and measure its real ink coverage, then sort by that. Fonts differ wildly. A '@' in one font is darker than in another.
Edge-aware characters. Pure brightness mapping throws away structure. Detect edge direction and use /, backslash, |, _ to follow the contour. Suddenly a face has actual line-drawing structure instead of a brightness cloud. This is the trick in the good ASCII renderers.

Bonus: feed the ASCII back as an image into img2img and the model reinterprets the text-structure into something between type and portrait. Text that remembers it was a face.

370 points · 5 comments

Comments

  • @reeseschmidtlab · · 71 points

    Edge-direction characters is the leap from 'brightness soup' to 'actual drawing'. The slash/pipe/underscore following contours gives you STRUCTURE. Brightness-only ASCII is just a bad halftone.

  • @kaidaviscreative · · 47 points

    acerola did a great video on exactly this edge-detection ASCII approach, the DOG (difference of gaussians) edge pass into directional glyphs. it's the difference between a tech demo and art.

  • @avasilva_ai · · 54 points

    measuring real glyph coverage per-font instead of using the canonical ramp is the kind of obsessive detail that separates good from fine. the ' .:-=+*#%@' ramp is a LIE for most fonts.

  • @harpernakamura_motion767 · · 44 points

    'text that remembers it was a face' go off poet. but seriously the img2img-the-ascii loop is a great idea, the model treats the characters as texture and hallucinates a face back through the type.