Draw ASCII
Renders an image or field as ASCII art using a cached glyph atlas and a single-pass GPU shader.
Category: Render Menu path: Render > DrawAscii
Ports
| Port | Type | Direction | Description |
|---|---|---|---|
in | imageRgba16f | input | Source image (optional -- luminance drives character selection) |
field_in | scalarField | input | Scalar field (optional -- overrides luminance for character selection) |
color_in | colorField | input | Color field (optional -- overrides per-cell color) |
out | imageRgba16f | output | Rendered ASCII art |
Parameters
| Param | Type | Default | Description |
|---|---|---|---|
characters | string | .:-=+*#%@ | Character ramp from darkest to brightest |
columns | scalar | 80 | Number of character columns across the output |
colorize | boolean | true | When enabled, cells inherit color from the source image |
foregroundColor | color | white | Character color when colorize is off |
backgroundColor | color | black | Background fill color |
fontFamily | string | Courier New | Font for glyph rendering |
fontWeight | scalar | 400 | Font weight |
gamma | scalar | 1.0 | Gamma curve applied to luminance before character lookup |
invert | boolean | false | Invert the luminance-to-character mapping |
Expose Channels
When enabled (E button on node header), adds input ports that override params via edge connections:
| Port | Type | Overrides |
|---|---|---|
columns_in | scalar | columns |
gamma_in | scalar | gamma |
How It Works
DrawAscii divides the output into a grid of cells based on columns (rows are calculated from the aspect ratio). For each cell, it samples the source luminance (from the input image or scalarField) and selects a character from the characters ramp. Darker regions map to earlier characters, brighter regions to later characters in the string.
The grid is comp-aligned: columns cells always span the composition width, anchored to the comp region, even when the layer evaluates on a larger overscan canvas. Cells continue across the overscan margin so a downstream Transform2D can slide or scale the ASCII output without revealing empty edges. The in branch participates in overscan like any image chain — a source scaled down through an upstream Transform2D is sampled in full, not cropped at comp bounds.
The glyph atlas is generated once per unique combination of font, weight, characters, and tile size, then cached in the engine. Glyphs are rasterized via the same lyon tessellation pipeline used by DrawShape. The fullscreen GPU shader samples this atlas to render the final output in a single pass.
When colorize is enabled, each cell takes its color from the source image (or from color_in if a color field is connected). When disabled, all characters use foregroundColor.
Field inputs (field_in, color_in) are evaluated in a CPU pre-pass that creates small lookup textures at the grid resolution. This allows procedural fields (Noise, DistanceField, Gradient) to drive the ASCII output without an intermediate texture.
Usage Examples
Basic: ASCII video
ImageSource -> DrawAscii -> Output. The image is rendered as monospaced ASCII art. Adjust columns to control density and gamma to tune the character distribution.
Field-driven characters
Connect a Noise.scalarField to field_in (leave in disconnected). The noise pattern drives character selection directly, creating animated procedural ASCII textures.
Custom color mapping
Connect a Gradient.colorField to color_in and disable colorize. Each cell's color comes from the gradient field evaluated at its position, independent of the luminance-to-character mapping.
Retro terminal look
Set characters to a simpler ramp like .#, use a green foreground color with black background, and set colorize to false for a monochrome terminal aesthetic.
Tips
- DrawAscii is a terminal generator (fills every pixel) -- it occupies the full canvas like Noise or Gradient, but unlike those it has an image input: that
inchain is walked for overscan, so upstream transforms behave exactly as they would feeding Output directly - The
charactersstring is ordered darkest to brightest. The first character represents minimum luminance, the last represents maximum. - Higher
columnsvalues produce finer detail but smaller characters - Gamma < 1 biases toward brighter characters, gamma > 1 biases toward darker characters
- Changing
fontFamily,fontWeight, orcharacterstriggers glyph atlas regeneration (cached afterward)
Related Nodes
- DrawShape -- rasterizes vector shapes (DrawAscii uses the same lyon pipeline internally for glyph atlas generation)
- Noise -- procedural scalarField source for field_in
- Gradient -- colorField source for color_in
- DistanceField -- SDF-based scalarField for field_in