User Rating 0.0
Total Usage 0 times
#00FF00
#000000
Enter ASCII art and click Preview
Is this tool helpful?

Your feedback helps us improve.

About

Animated GIF files encode frame sequences using the GIF89a binary specification with LZW compression. Manual conversion from ASCII art to GIF demands precise color quantization, correct sub-block packaging, and proper Graphic Control Extension headers for frame timing. A single misaligned byte in the LZW stream corrupts the entire output. This tool renders each ASCII text frame onto an HTML Canvas, extracts raw pixel data, quantizes colors to a 256-color palette, applies LZW compression per frame, and assembles a standards-compliant GIF89a binary. All encoding runs client-side in a Web Worker. No server uploads. No data leaves your browser.

Frame delay is specified in centiseconds (1 cs = 10 ms). The minimum reliable delay across browsers is approximately 2 cs (20 ms); values below this are clamped by most renderers to ~10 cs. Note: this tool approximates font rendering via the Canvas fillText API, which may produce slight glyph differences compared to terminal emulators depending on OS font availability.

ascii art gif converter animated gif text to gif ascii animation gif encoder lzw compression

Formulas

The GIF file format uses LZW (Lempel-Ziv-Welch) compression to encode indexed pixel data. Each pixel maps to an index in a color table of at most 256 entries. The LZW algorithm builds a dictionary of pixel sequences, replacing repeated patterns with shorter codes.

LZW(pixels) codes : code_size = min_code_size + 1 bits

The clear code is 2min_code_size and end-of-information code is 2min_code_size + 1. Dictionary entries start at index 2min_code_size + 2. When the dictionary reaches 212 = 4096 entries, a clear code resets it.

delayms = delaycs × 10

Where delaycs is the Graphic Control Extension delay value in centiseconds. The total animation duration is:

T = Ni=1 delayi

Where N = number of frames, delayi = delay of frame i in centiseconds. Color quantization maps 24-bit RGB pixels to the nearest palette entry using Euclidean distance in RGB space:

d = (r1 r2)2 + (g1 g2)2 + (b1 b2)2

Reference Data

ParameterDefaultRangeDescription
Frame Delay50 cs2 - 1000 csPause between frames (100 cs = 1 s)
Font Size16 px8 - 72 pxMonospace font size for rendering
Canvas Width480 px64 - 1920 pxOutput image width in pixels
Canvas Height320 px64 - 1080 pxOutput image height in pixels
Text Color#00FF00Any hexForeground color for ASCII characters
Background Color#000000Any hexCanvas background fill
Loop Count00 - 655350 = infinite loop
Frame Separator===Any stringDelimiter between ASCII frames
Max Color Table2562 - 256GIF global color table size
LZW Min Code Size8 bits2 - 8 bitsInitial LZW dictionary bit width
Disposal Method20 - 30=none, 1=keep, 2=restore bg, 3=restore prev
GIF89a HeaderGIF89a - Required 6-byte signature for animated GIF
NETSCAPE2.0App Extension - Application extension block enabling animation looping
Max Frames1001 - 100Safety limit to prevent memory exhaustion
Max File Size~50 MB - Practical browser memory limit for Blob creation

Frequently Asked Questions

Most browsers and image viewers clamp frame delays below approximately 2 cs (20 ms) to a default of ~10 cs (100 ms). This behavior originates from legacy GIF renderer implementations. Set delay to at least 2 cs for consistent behavior. For reliable slow animation, use values of 10 cs (100 ms) or higher.
ASCII art rendered on a canvas typically produces large uniform-color regions (the background) punctuated by thin character strokes. LZW excels at compressing such repetitive horizontal pixel runs. A 480×320 frame with sparse text may compress to under 5 KB per frame. Dense or multi-colored frames compress less efficiently. The dictionary resets at 4096 entries via a clear code, so very complex frames may produce larger output.
Text that extends beyond the canvas boundary is silently clipped by the Canvas API. No error is thrown. To prevent clipping, either reduce the font size, increase the canvas dimensions, or shorten the text lines. The preview panel shows exactly what will be encoded, so check it before generating.
The Canvas fillText API supports any character the browser's monospace font can render. Standard Unicode box-drawing characters (U+2500 - U+257F) and block elements (U+2580 - U+259F) work reliably. Emoji rendering depends on OS font support and may produce color glyphs that quantize poorly to 256 colors. Stick to ASCII range (U+0020 - U+007E) and box-drawing for best results.
GIF file size scales with canvas dimensions, frame count, and color complexity. A 480×320 canvas produces 153,600 pixels per frame. At 100 frames, that is 15.36 million pixels before compression. Reduce canvas size, use fewer colors (text + background = 2 effective colors compresses optimally), or reduce frame count. The tool enforces a 100-frame limit to prevent browser memory exhaustion.
Yes. Method 0 (unspecified) leaves renderer behavior undefined. Method 1 (do not dispose) overlays each frame on the previous, causing ghosting if frames differ in content. Method 2 (restore to background) clears each frame area to the background color before drawing the next, producing clean transitions. Method 3 (restore to previous) reverts to the state before the current frame was drawn. For most ASCII animations, method 2 is correct.