ANSI Text Export

Export your artwork as pure ANSI escape-code output that you can display directly in a terminal — no framework, runtime, or dependencies required.

Overview

Info

ANSI export produces raw terminal output. A single frame becomes a printable .ansi file, and an animation becomes a self-contained POSIX shell script that replays your timeline with the correct per-frame timing.

Unlike the Ink, OpenTUI, and Bubbletea exports — which generate source code for a TUI framework — ANSI export generates the terminal bytes themselves. It is the right choice when you want to:

  • cat a piece of ASCII art into a terminal
  • Drop art into a shell profile, MOTD, or login banner
  • Pipe colored output into another CLI tool
  • Ship a runnable animation that works on any machine with /bin/sh

Accessing ANSI Export

Click Export in the toolbar (or press Ctrl/Cmd+E)

Select ANSI Text from the format dropdown

Configure the settings below

Click Export to download

ANSI Settings

Filename

The base name for the downloaded file. The extension is applied automatically based on the output format:

Output formatExtension
Single frame.ansi
Runnable shell animation.sh

Color Mode

Choose the escape-code family based on your target terminal's capabilities:

OptionEscape codesDescription
ANSI 16\033[31m / \033[41mMaps each color to the nearest of the 16 standard ANSI colors. Maximum compatibility, and colors follow the user's terminal theme.
xterm-256\033[38;5;NmMaps each color to the nearest xterm-256 palette entry. The best balance of fidelity and compatibility — works in Terminal.app, iTerm2, Windows Terminal, and most modern terminals.
Truecolor\033[38;2;R;G;BmEmits exact 24-bit RGB values. Highest color accuracy, but requires a terminal with true color support.
Tip

Which should I choose?

  • Use xterm-256 as the default — it looks close to the canvas almost everywhere.
  • Use Truecolor when exact colors matter and you know the terminal supports 24-bit color (iTerm2, Kitty, Alacritty, WezTerm, Windows Terminal).
  • Use ANSI 16 for SSH sessions, legacy terminals, or when the art should adopt the user's color scheme.

Output Format

OptionResult
Single frameExports the currently selected frame as a .ansi file containing raw escape codes and characters. Printing the file renders the frame.
Runnable shell animationExports every frame of the timeline as a .sh script. Each frame is redrawn in place and held for its own timeline duration.

Loop Animation

Available only in Runnable shell animation mode.

OptionBehavior
EnabledThe script replays from the first frame until you interrupt it (default)
DisabledThe script plays through once and exits

Clear Terminal Before Frame

When enabled, the output clears the screen and draws from the terminal origin. Disable it if you want the art to print inline below your current prompt output — useful when piping into another command or appending to a banner.

Include Metadata

Adds project details (name, dimensions, frame count, export date) to the output.

  • In single frame mode the metadata is printed as visible lines above the art.
  • In animation mode it becomes non-rendering # shell comments, so it never appears on screen.

This is off by default so the artwork is the only thing that renders.

Displaying the Export in Your Terminal

Single Frame (.ansi)

Print the file directly:

bash
cat my-art.ansi

To page through a tall piece of art while preserving colors, pass -R to less:

bash
less -R my-art.ansi
Warning

Plain less (without -R) shows literal escape sequences such as ESC[38;5;208m instead of colors. The -R flag tells it to pass control characters through to the terminal.

Other useful ways to display it

bash
# Print it on every new shell (add to ~/.zshrc or ~/.bashrc)
cat ~/art/my-art.ansi
 
# Use it as a login banner on a server
sudo cp my-art.ansi /etc/motd
 
# Pipe it into another command
cat my-art.ansi | tee /dev/tty > /dev/null

The exported file always ends with a reset sequence, so your prompt colors are restored after printing.

Animation (.sh)

Run the script with sh:

bash
sh my-animation.sh

Or make it executable once and run it directly afterwards:

bash
chmod +x my-animation.sh
./my-animation.sh

Press Ctrl+C at any time to stop playback. The script hides the cursor while playing and restores the cursor and default colors on exit — including when it is interrupted.

Info

The generated script only uses printf and sleep from a POSIX shell. There is no Node, Python, or package dependency, so it runs on macOS, Linux, WSL, and most BSDs out of the box.

Output Structure

Single Frame

A .ansi file is a plain text file containing characters interleaved with SGR escape sequences. Only color changes are emitted, which keeps the file small:

text
\033[38;5;208m\033[48;5;236m###\033[39m\033[49m
\033[38;5;33m ~~ \033[0m

Animation Script

bash
#!/bin/sh
# Generated by ASCII Motion
 
cleanup() {
  printf '\033[0m\033[?25h\n'
}
trap cleanup EXIT
trap 'exit 0' HUP INT TERM
 
printf '\033[?25l'   # hide cursor
printf '\033[2J'     # clear screen (when enabled)
 
while :; do
  printf '\033[H%s' '...frame 1 data...'
  sleep 0.125
  printf '\033[H%s' '...frame 2 data...'
  sleep 0.25
done

Each sleep value comes from that frame's duration on the timeline, so playback matches what you see in the editor. Frames are redrawn at the terminal origin (\033[H) rather than reprinted, which prevents scrolling.

Comparing Terminal Exports

FeatureANSI TextInkOpenTUIBubbletea
OutputRaw terminal bytesTypeScriptTypeScriptGo
DependenciesNoneNode + InkNode + OpenTUIGo + Bubbletea
Runs standaloneYesNoNoNo
Embeddable in an appNoYesYesYes
Interactive controlsNoYesYesYes
Best forBanners, art, quick demosCLI appsCLI appsCLI apps

Tips

  • Keep the canvas width under your terminal width to avoid wrapped rows.
  • Turn Clear terminal before frame off when appending art to existing shell output.
  • Use xterm-256 when sharing a file with others — it degrades gracefully across terminals.
  • For a looping animation on a shared machine, test with loop disabled first so it exits on its own.
  • Post-processing effects are not represented in ANSI output and are excluded from terminal exports.

Troubleshooting

I see ESC[38;5;... instead of colors

The output is being read by something that does not interpret escape codes. Use cat, or less -R instead of less. Text editors will always show the raw sequences.

Colors look wrong or washed out

  • Your terminal may not support the selected color mode. Drop from Truecolor to xterm-256.
  • In ANSI 16 mode, colors intentionally follow your terminal theme rather than the canvas.
  • Check that TERM is set to something like xterm-256color.

The animation flickers or scrolls

  • Make the terminal window at least as tall as the canvas plus one row.
  • Keep Clear terminal before frame enabled for animations.
  • Reduce the frame count or canvas size if the terminal cannot keep up.

My prompt stays colored after running

Press Ctrl+C rather than closing the terminal mid-frame, or run printf '\033[0m\033[?25h' to reset manually. The script's cleanup handler normally does this for you.

Permission denied when running the script

Run it through the shell with sh my-animation.sh, or grant execute permission with chmod +x my-animation.sh.

Requirements

  • Any terminal with ANSI escape-code support (all modern terminals)
  • For animations: a POSIX shell (/bin/sh) — macOS, Linux, WSL, BSD
  • For Truecolor mode: a terminal with 24-bit color support