ASCII Art
Visual art created from text characters, originally limited to the 95 printable ASCII characters. Unicode expands the palette with box-drawing characters, block elements, and braille patterns.
What is ASCII Art?
ASCII art is the practice of creating visual images, diagrams, and decorative text using characters from the ASCII character set (or, in modern usage, the broader Unicode character set). It originated in the era of teletype and early computer terminals, where bitmap graphics were unavailable and all output was character-based. ASCII art spread through bulletin board systems (BBS), Usenet, email signatures, and early web pages in the 1980s and 1990s.
While classic ASCII art uses the 95 printable ASCII characters (U+0020–U+007E) — particularly letters, digits, slashes, underscores, and pipe characters — Unicode dramatically expanded the creative palette available to text-based artists with three key character ranges.
Unicode Box-Drawing Characters (U+2500–U+257F)
The Box Drawing block (128 characters) provides lines and corners for drawing rectangular diagrams, table borders, and flow charts entirely in text. These characters are drawn to align precisely with adjacent box-drawing characters, making them ideal for terminal user interfaces (TUIs), data tables, and tree displays.
┌─────────────────┐
│ Unicode Table │
├──────┬──────────┤
│ Code │ Name │
├──────┼──────────┤
│U+2500│ BOX DRAW │
│U+2502│ VERTICAL │
└──────┴──────────┘
Heavy and double-line variants (┃, ━, ╔, ╗, ╠, ╣) allow visual hierarchy in complex diagrams. Frameworks like rich (Python) and blessed use these characters extensively.
Unicode Block Elements (U+2580–U+259F)
The Block Elements range (32 characters) provides fractional block fills — upper half, lower half, left quarter, right quarter, and eight levels of vertical fill. These allow pixel-level approximation in a character grid, enabling grayscale images to be rendered in terminal output.
▓▒░ ← Full, medium, light shade
▄▀█ ← Lower half, upper half, full block
Modern terminal image viewers like catimg and viu use block elements to display photographs at quarter-cell resolution, giving the impression of twice the vertical resolution of the character grid.
Unicode Braille Patterns (U+2800–U+28FF)
The Braille Patterns block (256 characters) encodes all possible combinations of the 8 dots in a Braille cell. While designed for tactile display devices, these characters are also used by Unicode artists to achieve very high-resolution text art, since each Braille character can represent an 2×4 grid of on/off pixels — giving 8 "pixels" per character cell.
# Each Braille character is a 2x4 dot matrix
# Bit positions: 1 4
# 2 5
# 3 6
# 7 8
# U+2800 = all dots off (blank)
# U+28FF = all 8 dots on (⣿)
Terminal art generators use Braille to render bitmap images at approximately 160 DPI equivalent in a standard 80×24 terminal.
Quick Facts
| Property | Value |
|---|---|
| Classic ASCII art range | U+0020–U+007E (95 printable ASCII characters) |
| Box Drawing block | U+2500–U+257F (128 characters) |
| Block Elements block | U+2580–U+259F (32 characters) |
| Braille Patterns block | U+2800–U+28FF (256 characters) |
| Braille pixel density | 8 pixels per character cell (2×4 grid) |
| Notable Python library | rich (box-drawing for terminal UI) |
| Historical origin | Teletype terminals, BBS culture (1970s–1990s) |
相关术语
编码 中的更多内容
美国信息交换标准代码。7位编码,涵盖128个字符(0–127),包括控制字符、数字、拉丁字母和基本符号。
Binary-to-text encoding that represents binary data using 64 ASCII characters (A–Z, a–z, …
主要在台湾和香港使用的繁体中文字符编码,收录约13,000个CJK字符。
扩展二进制编码十进制交换码。IBM大型机编码,字母范围不连续,至今仍用于银行和企业大型机。
基于KS X 1001的韩语字符编码,将韩文音节和汉字映射为双字节序列。
简体中文字符编码系列:GB2312(6,763字)经GBK演化为GB18030,成为与Unicode兼容的中国强制性国家标准。
由IANA维护的字符编码名称官方注册表,用于HTTP Content-Type头和MIME(如charset=utf-8)。
针对不同语言组的8位单字节编码系列,ISO 8859-1(Latin-1)是Unicode前256个码位的基础。
将单字节ASCII/JIS罗马字与双字节JIS X 0208汉字相结合的日语字符编码,仍在传统日语系统中使用。
仅覆盖BMP(U+0000–U+FFFF)的废弃固定2字节编码,是UTF-16的前身,无法表示补充字符。