art
pictures made of text: clip art, colored text, QR codes, images, and animation
Permissions: files.read
Art covers anything drawn with characters. It has ready-made clip art, colored text, QR codes and images turned into text, plus animation. The submodules arrange pictures, grow them from rules, draw games, and render big letters and photos.
cliparta piece of clip art from the built-in gallery by name, or with no name, the list of namesrainbowcolor text with a rainbow running diagonally across itgradientcolor text with a fade from one color on the left to another on the rightqra QR code for the text that phones can scan off the screensegmentsbig digits like a digital clock’s, for 0-9, A-F, -, ., : and spacesimgdraw an image, from its path or its bytes, width characters wide (the terminal’s width without one, or 80)lsbthe low bits of an image’s pixels as bytes, the usual way to hide a message in a picturebit_planeone bit of one color channel of an image as a black and white PNG, white where the bit is setanimateplay an animation in the terminal at fps frames a second
Functions
Section titled “Functions”clipart
Section titled “clipart”clipart(name?: str) -> str|list
a piece of clip art from the built-in gallery by name, or with no name, the list of names
1clipart("owl") ,_,
(O,O)
( )
-"-"-2clipart().len19rainbow
Section titled “rainbow”rainbow(s: str) -> str
color text with a rainbow running diagonally across it
1"rainbow".rainbowrainbowSee also gradient, strip_ansi
gradient
Section titled “gradient”gradient(s: str, from: str|list, to: str|list) -> str
color text with a fade from one color on the left to another on the right
1gradient("sunset", "gold", "crimson")sunsetqr(text: str, ec: str = “M”) -> str
a QR code for the text that phones can scan off the screen
ec is how much damage it can survive and still scan: “L” 7%, “M” 15%, “Q” 25% or “H” 30%. Higher makes a bigger code
1qr("zil")█████████████████████████████
█████████████████████████████
████ ▄▄▄▄▄ █▄▀▄███ ▄▄▄▄▄ ████
████ █ █ █▀▄██ █ █ █ ████
████ █▄▄▄█ █ █ ▀▄█ █▄▄▄█ ████
████▄▄▄▄▄▄▄█ █▄▀ █▄▄▄▄▄▄▄████
████ ▀██ █▄▄▄█▀ ▀▄▄ ▄▄█▀▄████
████▀▄▄▀▀▀▄ █▄▀▄█▀ ▄ ██▄▀████
████████▄█▄█ ██ ██▀█▄█████
████ ▄▄▄▄▄ █▄█ ▀ ▄█▀█ █ ▀████
████ █ █ █▄ ▀ ▀█▄ ▄▀▄ ████
████ █▄▄▄█ ██▄▀▄█▀ ▄ ▄ ██████
████▄▄▄▄▄▄▄█▄▄▄█▄▄▄███▄█▄████
█████████████████████████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀See also url_build
segments
Section titled “segments”segments(s: str|int) -> str
big digits like a digital clock’s, for 0-9, A-F, -, ., : and spaces
1segments("12:45") ▄▄ ▄▄
█ ▄▄█ • █▄▄█ █▄▄
█ █▄▄ • █ ▄▄█2segments("C0FFEE") ▄▄ ▄▄ ▄▄ ▄▄ ▄▄ ▄▄
█ █ █ █▄▄ █▄▄ █▄▄ █▄▄
█▄▄ █▄▄█ █ █ █▄▄ █▄▄img(file: str|bytes, width?: int, mode: str = “blocks”) -> str
draw an image, from its path or its bytes, width characters wide (the terminal’s width without one, or 80)
mode is “blocks”, two pixels per character in full color, “ascii”, brightness drawn with the characters .:-=+*#%@ so it pastes anywhere, or “braille”, black-and-white dots, 8 per character, the sharpest of the three
1img("cat.png")2img("logo.jpg", 40, "ascii")3img("photo.png", 60, "braille").negativeSee also negative, boxed, bit_plane
lsb(file: str|bytes, bits: int = 1, channels: str = “rgb”) -> bytes
the low bits of an image’s pixels as bytes, the usual way to hide a message in a picture
Takes a path or bytes. Reads bits (1 by default) from each of channels, any of “r”, “g”, “b” and “a” in order, pixel by pixel along each row from the top, and packs them most significant first. Try .str or magic on the result
1lsb("secret.png")[..32].str2lsb("secret.png", 2, "b")See also bit_plane, png_chunks
bit_plane
Section titled “bit_plane”bit_plane(file: str|bytes, channel: str, bit: int) -> bytes
one bit of one color channel of an image as a black and white PNG, white where the bit is set
Takes a path or bytes. channel is “r”, “g”, “b” or “a”, and bit goes from 0, the lowest, to 7. Hidden pictures and text often show up in bit 0, so draw the result with img
1img(bit_plane("secret.png", "r", 0))animate
Section titled “animate”animate(frames: list|fn, fps: num = 10.0, count?: int) -> nil
play an animation in the terminal at fps frames a second
A list of pictures plays count times (once without one), and a function is called with each frame number from 0 and plays count frames (60 without one). When the output isn’t a terminal, only the last frame is printed
1animate(|i| life("glider", i), 8, 40)2animate(["|", "/", "-", "\\"], 12, 5)More examples
Section titled “More examples”gallery
Section titled “gallery”1# the names of every piece in the gallery2clipart()["cat", "dog", "owl", "bunny", "cow", "pikachu", "fish", "duck", "bat", "snail", "crab", "ghost", "skull", "coffee", "rocket", "house", "tree", "cactus", "heart"]3# a cat in a box4clipart("cat").boxed("round")╭─────────╮
│ /\_/\ │
│ ( o.o ) │
│ > ^ < │
╰─────────╯5# a rainbow banner6banner("zil", "slant").rainbow _ __
____ (_) /
/_ / / / /
/ /_/ / /
/___/_/_/7# color codes don't count once stripped8rainbow("hi").strip_ansi.len29# a QR code to scan with your phone10qr("https://github.com/zbu1/zil")█████████████████████████████████████
█████████████████████████████████████
████ ▄▄▄▄▄ █▄ █▄▄▄ █▄██ █ ▄▄▄▄▄ ████
████ █ █ █▄▀▄ █▄█▀▀ █▄▀█ █ █ ████
████ █▄▄▄█ █▀▀▀▄▄▀▀▄ ▀ ███ █▄▄▄█ ████
████▄▄▄▄▄▄▄█▄▀ ▀▄▀▄█▄█ ▀▄█▄▄▄▄▄▄▄████
████▄▀ ▀██▄▄▀ ▄ ▄█▄ ▀▀ ▀▀ ██▄▀ ████
████▄▀█▄▀▀▄▄ █ ▄▄ ▀ █▄ ▄▀▄▄ ▄█▄████
████ ▄▀▄▀ ▄ ▀▄▀▄█ ██▀█▀▀█ ███▀ ████
████▄▄ ▀▄▀▄▀▄ ▄▄▀█▄█▄ ▀▄ ▄███▄████
████▄█▀▄█ ▄▄██ █▄█▄ ▀█▀▄▄ ▀██▀▀ ████
████▄▄██▀█▄▀█▄▄ ▄ ▀ ▄█▄▀█▀█ ▄██▄████
████▄▄█▄▄█▄█ █▀█▄ ██ ▄█ ▄▄▄ ▀▄▀████
████ ▄▄▄▄▄ █▄█▀ ▄▀█▄█▀█▀ █▄█ ██▀ ████
████ █ █ ███▀█ ▄█▄ ▄█ ▄▄ ▀ █████
████ █▄▄▄█ █▄▀ ▄▀█▀ ▄ █▀▄█▀ ▀█▄▄████
████▄▄▄▄▄▄▄█▄█▄█▄▄▄██▄▄█▄███▄▄██▄████
█████████████████████████████████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀11# a big clock12segments(now.format("%H:%M")) ▄▄ ▄▄
█ ▄▄█ • █ ▄▄█
█ █▄▄ • █ █▄▄Example results generated on 2026-11-04. Ones using now, today or randomness will differ when you run them.