3 ASCII art is the [art](art.md) of (mostly manually) creating graphics and images only out of [fixed-width](fixed_width.md) (monospace) [ASCII](ascii.md) characters. Strictly speaking this means no [Unicode](unicode.md) or extended ASCII characters are allowed -- these would rather be called Unicode art, [ANSI art](ansi_art.md) etc., though the term ASCII art is quite often used loosely for any art of this kind. If we keep being pedantic, ASCII art might also be seen as separate from mere [ASCII rendering](ascii_rendering.md), i.e. automatically rendering a bitmap image with ASCII characters in place of [pixels](pixel.md), and ASCII graphics that utilizes the same techniques as ASCII art but can't really be called art (e.g. computer generated diagrams); though in practice this distinction is also rarely made. Pure ASCII art is [plain text](plain_text.md), i.e. it can't make use of [color](color.md), text decoration and other [rich text](rich_text.md) formatting.
5 This kind of art used to be a great part of the [culture](culture.md) of earliest [Internet](internet.md) and near-Internet (e.g. [BBS](bbs.md)) communities for a number of reasons imposed largely by the limitations of old computers -- it could be created easily with a text editor and saved in pure text format, it didn't take much space to store or send over a network and it could be displayed on text-only displays and [terminals](terminal.md). The idea itself even predates computers, people were already making this kind of images with type writers, e.g. some poets were formatting their poems with typewriters to picture-shapes. Despite the technical limitations of displays having been overpassed, ASCII art survives even to present day and lives on in the [hacker culture](hacking.md), among [programmers](programming.md), in [Unix](unix.md) and "retro" game communities as well as on the [Smol Internet](smol_internet.md), among people who just want to [keep it simple](kiss.md) and so on. ASCII diagram may very well be embedded in a comment on a text-only forum or in source code to explain some spatial concept. ASCII art may even be superior for making certain types of drawings from purely user perspective exactly by being simplified, it can be performed merely with keyboard with little distraction (not caring about colors, not having to focus on right angles, to care about line thicknesses, switching tools, deleting imprecise strokes, ...), similarly to how for example it may be easier to create a rough model of a house in [Minetest](minetest.md) than to model it in [Blender](blender.md). { I found that for making quick diagrams I prefer ASCII art to graphic tools. ~drummyfish } We, [LRS](lrs.md), highly advocate use of ASCII art whenever it's [good enough](good_enough.md).
7 Here is a simple 16-shade ASCII [palette](palette.md) (but watch out, whether it works will depend on your font): `#OVaxsflc/!;,.- `. Another one can be e.g.: `WM0KXkxocl;:,'. `.
9 Here are approximate brightness values for each printable ASCII character, with 0 being black and 1000 white (of course the values always depend on the specific [font](font.md) you use):
11 { I obtained the values by shooting a screen with some generic monospace font in gedit or something, then made a script that computed the values and ordered them. ~drummyfish }
14 @ 577 P 727 A 777 ? 827 / 867
15 W 615 w 735 Z 777 I 830 > 867
16 M 640 3 740 h 779 j 831 \ 867
17 0 641 X 741 Y 786 C 834 < 868
18 Q 656 D 744 [ 797 ) 836 c 870
19 & 658 V 745 T 797 ( 837 + 874
20 % 664 b 746 e 798 l 837 J 892
21 R 664 p 747 } 800 x 838 " 911
22 8 676 5 748 a 800 i 848 ; 912
23 # 685 d 748 { 803 z 851 _ 912
24 O 685 2 750 ] 809 r 853 ~ 924
25 $ 687 4 750 y 810 ^ 854 : 936
26 B 702 S 750 1 811 s 855 , 942
27 6 707 q 751 7 812 v 855 - 953
28 9 708 k 759 F 812 ! 856 ' 954
29 g 711 G 765 o 813 t 856 . 968
30 N 715 K 767 f 815 * 857 ` 969
31 U 724 E 768 u 825 = 860 1000
32 m 727 H 771 n 826 L 866
35 And here are some attempts at actual ASCII art:
41 |\ \_ /_==-"""' .~~~~~~~~;~~~~~~~~.
42 | |:---' ( | ASCII | tables |
43 \ \__." ) Steamer |========I========|
44 '--_ __--' Duck! | are | |
48 [] [][][][][] | best | tables |
49 [][][] [][] |________|________|
53 [][] [] ____ _____ _____
54 [][][] [][] [ _) [ _ \ / ____]
55 [] [][][][][] ) { } |_) )\___ \
57 SAF FTW }_____|}_{ \_][_____/
61 \ / \ / \ / KEEP IT SIMPLE
67 |/__________\____________/__________\______
74 '.|.' . : ___ (._. ) everyone
75 --{O}-- .;::.':.' __{ )_ /\ /) so
76 .'|'. _.:'' ' : {_ \ } _} VV retarded
79 / \\ \\ ,' '. (_) __ \ \
80 /____\\______\\ ( o ) _ |__] ) )
81 \,,,|,,,,,,,/ '")("o (_) / /
82 |___|_[H]___|=|=|=|=|=|=|=|=| '-'
85 ____ | |__ ___ __| | ___ / __] ____ | | (_)
86 / _ ]| _ \ / __] / _ | / _ \ [ _] / _ ] | '--. ;";
87 ( (_| {| |_) )| (__ ( (_| || ___) | | ( (_| | | .-. | | |
88 \____]|____/ \___] \____| \___] |_| \__ | |_| |_| |_|
90 (_) | | __ | | _ _ ____ ___ ____ ____ ____
91 ;"; | |/ / | | | "-" || _ '. / _ \ | _ \ / _ | | _ |
92 | | | { | | | ;_; || | | |( (_) )| |_) )( (_| | | | "'
93 _/ | |_|\_] \_\ |_| |_||_| |_| \___/ | __/ \__ | |_|
95 ____ | | _ _ _ _ _ _ _ _ _ _ ____
96 ( __|[ ] | || || [ ] | | |/\| | | \_/ | [ | | | |__ ]
97 \_"\ | |_ | || | \ " / | ' ' | } _ { \ \| | ,' /
98 [____) (___]',__,' \_/ \_/\_/ |_/ \_| _) / |____]
102 The following is a raster picture auto-converted to ASCII: { For copyright clarity, it's one of my OGA pictures. ~drummyfish }
110 -!;.;,;cl;c##aV#s,....ca//cfs!;;.--,,,;
111 !;;/s/,,c/slc;,;/#l!as;!f/c;;cVOfOf;---.s#c-
112 -OOfl,,,,;/,,,!ll.!;!,,!c/!;;!/;cxxO/.;aO##a/,.,!,c;.
113 !,;,,,,!!,/f/c!a,,,!//c;;;;;;;!cVOV/lf/......------,l/;.---
114 !.!/!/!/;,//c! ;#s,///;;;;;;!c/a#l;-.----....------.,...,..;,-
115 ;x/;;;cslsac #a!,,;;/,,./casl,---..!cxfs/.,.,!x#xl....-.;,/l,
116 -;;;;;- s;!V....;;;lca#/.---;f#Vxcf######s;.,..-----,,;ssa.
117 xxl!,,,.!,//c##l ;/c!.,;....c#/.;ac,.,----.,,,fs;a,
118 !Os;!!c,scfa##x- ---,,,,/,,..###x#;.,!-!,-.lc/cfx/#f
119 xOOs##lO##f;;, ,-,,,,,,,;l#V;,!/,,,;.#--l#.;;/!,,#!
120 - !##,,,,, -ax;,,,,,.,f/...c//!./;-#,-##!,,c! ,l;/-
121 /#c- -/, ##/;,,,,,;./,,,;lclll/ -.V##.,,,c! !.,/;
122 /##! -.;,;#/,,,,,;,l,,,,,sl,x### - ,#/,,,,c; c,.,l/.
123 ls#,,,,l.#f.,,,.ff/;;;;O; ;l/s ---;#;,,;V ./lOcfl!.-
124 .lf#;,;/!Vl,,,,,xccccs/ ac/,--xf;,,,;# #////f#l,
125 l/cflc/;.;al/;lclx!, .f//--.;,,,,O f/fcx##l.
126 ;s////l-;f#;,;,-- s//f;,,!,,;/ l#xf.c/!!
127 ,;,//!--;;,,,c !///x.,,,,f- -c/f ./,/
128 ,fl!flll.,!/cc, .ll//f;,,,,/; !;;. ,,;/
129 lf;!;!O/,;c;l!fc -fllclc/!!,,!l -,;;!- ;;!
130 ////cc;llVcl/f #s/lccx;.!/c/c. .,lc!, !;;
131 ./,,,!c--..,,,! x//cf#fscf/c/f. c,f; ;;!
132 -f///!!;---,.,!,f .cc!;/!f;;;//sf. .fl! !flls,
133 - fxl;#/!V/fc/ l! ,!;;;c ;l/lc- ,#Olcs;
134 - -!,-,l!; x.;a!/cfc ./ff; !.-
137 { TODO: what would ASCII art made of ASCII font look like??? ~drummyfish }
139 The are many tools for this, but for educational purposes this one was made using the following custom [C](c.md) program:
144 const char palette[] = "#OVaxsflc/!;,.- ";
154 if (c > '9' || c < '0')
157 r = r * 10 + c - '0';
163 void skipAfterNewline(void)
165 while (getchar() != '\n');
170 skipAfterNewline(); // skip magic number
171 skipAfterNewline(); // skip header
173 int w = readNum(); // read width
174 int h = readNum(); // read height
176 skipAfterNewline(); // skip to pixels
178 for (int j = 0; j < h; ++j) // read rows
180 for (int i = 0; i < w; ++i) // read columns
182 /* The following is a bit cryptic way of reading RGB, averaging it (giving
183 higher significance to green, for human sight bias) to convert it to
184 grayscale and then getting it to range 0 to 15 (palette size). */
185 int v = ((getchar() + getchar() * 2 + getchar()) * 16) / (4 * 256);
196 This program is extremely simple, it just reads an image in [PPM](ppm.md) format on standard input and outputs the image to terminal. Watch out, it won't work for all PPM images -- this one worked with a picture exported from [GIMP](gimp.md) in raw RGB PPM. Also note you have to scale the image down to a very small size AND its aspect ratio has to be highly stretched horizontally (because text characters, i.e. pixels, are much more tall than wide). Also for best results you may want to mess with brightness, contrast, sharpness etc.
200 - [ANSI art](ansi_art.md)
201 - [ASCII animation](ascii_animation.md) (e.g. [vt100](vt100.md) terminal animations, [asciinema](asciinema.md), ...)
202 - [pixel art](pixel_art.md)
203 - [plain text](plain_text.md)
204 - [emoticon](emoticon.md)
205 - [cowsay](cowsay.md)
206 - [figlet](figlet.md)