Staaarter

ANSI Art to GIF Converter

Parses pasted ANSI SGR escape-coded text (16-color, 256-color, and 24-bit truecolor foreground codes), renders each character cell as a solid color block, and encodes the result, optionally multiple frames, as a real GIF via this category's shared encoder. A free online tool from Staaarter, right in your browser.

Runs locallyUpdated 2026-07-29
By Staaarter Team
ascii-artgifimage-conversion

Overview

Introduction

ANSI art, colored blocks built from terminal escape codes, has a long BBS and demoscene history, and sometimes you want to turn a piece of it back into a real, viewable image rather than reading it in a terminal.

This tool renders pasted ANSI-colored text into a GIF entirely in the browser, no terminal required to view the result.

What Is ANSI Art to GIF Converter?

A text-to-GIF converter that parses ANSI SGR foreground-color escape codes out of pasted terminal art and renders each character cell as a solid color block, reusing the PNG Image Tools category's `convertAnsiArtToPng` renderer.

It optionally supports multi-frame input (split on a "===FRAME===" delimiter line, the same format GIF to ANSI Art Converter emits) to rebuild a small animation.

How ANSI Art to GIF Converter Works

Pasted text is optionally split into multiple frames on a "===FRAME===" delimiter line.

Each frame is scanned for ANSI SGR escape sequences (ESC[...m); the currently active foreground color is tracked and applied to every subsequent character cell until the next color-changing sequence.

Each frame's grid of colored cells is rasterized into a pixel image at a configurable cell size, then all frames are encoded together as a GIF via this category's shared `encodeGif`, which requires every frame to share identical dimensions.

When To Use ANSI Art to GIF Converter

Use it to turn ANSI art (BBS-style banners, CLI tool output, terminal screenshots described as text) into an actual shareable image.

Also useful for completing a round trip after using GIF to ANSI Art Converter, to verify the ANSI representation reproduces the original image reasonably.

Features

Advantages

  • Understands three real ANSI color code families (16-color, 256-color, truecolor), not just a single simplified format.
  • Reuses a proven rasterizer (`convertAnsiArtToPng`) rather than a new, untested rendering path.
  • Supports rebuilding a multi-frame animation from delimited ANSI text, not just a single static image.

Limitations

  • Background colors, bold, underline, and other SGR attributes beyond foreground color are ignored entirely.
  • All frames must render to identical pixel dimensions; mismatched frame sizes fail the whole conversion rather than being auto-resized.
  • Very large cell sizes or long, wide ANSI art can produce an image exceeding GIF's maximum dimensions.

Examples

Rendering a single-frame colored block

Input

\x1b[38;2;255;0;0m██\x1b[0m\n\x1b[38;2;0;0;255m██\x1b[0m

Output

A 2x2-cell GIF: a red block on top, a blue block below.

Each line's truecolor escape code sets that row's cell color; newlines start a new row.

Best Practices & Notes

Best Practices

  • Match cell size to how large you want the final image; larger cell sizes produce a blockier, more visibly pixelated look.
  • If building a multi-frame animation, generate all frames the same way (same column/row count) to avoid a dimension-mismatch error.
  • Use GIF to ANSI Art Converter to produce known-good, correctly-delimited multi-frame input if you're testing the round trip.

Developer Notes

ANSI parsing and rasterization are entirely delegated to `convertAnsiArtToPng()` from `png/lib/ansi-art-to-png-converter.ts`, reused as-is per frame; this tool's own code only splits multi-frame input on the shared `===FRAME===` delimiter and passes the resulting `PixelBuffer`s to this category's shared `encodeGif`, which itself enforces the equal-dimensions requirement.

ANSI Art to GIF Converter Use Cases

  • Converting BBS-style or demoscene ANSI art into a shareable, viewable GIF image
  • Rebuilding a small animation from ANSI text produced by GIF to ANSI Art Converter
  • Rendering CLI tool output or terminal screenshots (described as ANSI text) as an actual image

Common Mistakes

  • Pasting frames with different row or column counts and being surprised by a dimension-mismatch error; GIF requires every frame to share one size.
  • Expecting background colors or bold/underline styling to appear in the output; only foreground color is rendered.

Tips

  • If you're building multi-frame input by hand, double-check each frame's line count and line lengths match before separating them with "===FRAME===".
  • Start with a small cell size and a simple test pattern to confirm your escape codes parse the way you expect before converting something large.

References

Frequently Asked Questions