Skip to content

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

PortTypeDirectionDescription
inimageRgba16finputSource image (optional -- luminance drives character selection)
field_inscalarFieldinputScalar field (optional -- overrides luminance for character selection)
color_incolorFieldinputColor field (optional -- overrides per-cell color)
outimageRgba16foutputRendered ASCII art

Parameters

ParamTypeDefaultDescription
charactersstring .:-=+*#%@Character ramp from darkest to brightest
columnsscalar80Number of character columns across the output
colorizebooleantrueWhen enabled, cells inherit color from the source image
foregroundColorcolorwhiteCharacter color when colorize is off
backgroundColorcolorblackBackground fill color
fontFamilystringCourier NewFont for glyph rendering
fontWeightscalar400Font weight
gammascalar1.0Gamma curve applied to luminance before character lookup
invertbooleanfalseInvert the luminance-to-character mapping

Expose Channels

When enabled (E button on node header), adds input ports that override params via edge connections:

PortTypeOverrides
columns_inscalarcolumns
gamma_inscalargamma

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 in chain is walked for overscan, so upstream transforms behave exactly as they would feeding Output directly
  • The characters string is ordered darkest to brightest. The first character represents minimum luminance, the last represents maximum.
  • Higher columns values produce finer detail but smaller characters
  • Gamma < 1 biases toward brighter characters, gamma > 1 biases toward darker characters
  • Changing fontFamily, fontWeight, or characters triggers glyph atlas regeneration (cached afterward)
  • 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

Caddis — professional motion design.