art.frames
boxes, cowsay; art side by side, stacked, overlaid, mirrored, rotated, scaled
Example results generated on 2026-10-08. Ones using
now,todayor randomness will differ when you run them: press Run on any example to run it in your browser, after editing it if you like.
Functions
| function | description |
|---|---|
boxed(s: str, style?: str) | draw a box around text; style is “single” (default), “double”, “round”, “heavy”, “ascii”, “stars” or “shadow” |
cowsay(s: str, critter?: str) | a critter saying s in a speech bubble; critter is “cow” (default), “cat”, “ghost” or “crab” |
think(s: str, critter?: str) | like cowsay, in a thought bubble |
beside(a: str, b: str, gap?: int) | put b to the right of a, tops aligned, gap spaces apart (default 1) |
stack(a: str, b: str, align?: str) | put b under a, aligned “left” (default), “center” or “right” |
overlay(a: str, b: str, x: int, y: int) | draw b over a with its top-left at column x, row y; spaces in b are see-through |
mirror(s: str, axis?: str) | flip left-right (“h”, default) or upside down (“v”), turning slashes and brackets to match |
rotate(s: str, degrees: int) | turn art clockwise by 90, 180 or 270 degrees |
scale(s: str, n: int) | make every character an n×n block of itself |
negative(s: str) | swap ink and background: spaces become blocks, blocks and braille dots invert |
trim_art(s: str) | drop blank lines at the ends, shared left indentation and trailing spaces |
boxed
boxed(s: str, style?: str): draw a box around text; style is “single” (default), “double”, “round”, “heavy”, “ascii”, “stars” or “shadow”
boxed("hello")
# → ┌───────┐
# → │ hello │
# → └───────┘
"zil\ncalc".boxed("round")
# → ╭──────╮
# → │ zil │
# → │ calc │
# → ╰──────╯
cowsay
cowsay(s: str, critter?: str): a critter saying s in a speech bubble; critter is “cow” (default), “cat”, “ghost” or “crab”
cowsay("moo")
# → _____
# → < moo >
# → -----
# → \
# → \
# → (__)
# → (oo)
# → /-------\/
# → / | ||
# → * ||----||
# → ~~ ~~
think
think(s: str, critter?: str): like cowsay, in a thought bubble
think("hmm", "ghost")
# → _____
# → ( hmm )
# → -----
# → o
# → o
# → .-.
# → (o o)
# → | O \
# → \ \
# → `~~~'
See also: cowsay
beside
beside(a: str, b: str, gap?: int): put b to the right of a, tops aligned, gap spaces apart (default 1)
"a\nb".beside("c\nd\ne")
# → a c
# → b d
# → e
stack
stack(a: str, b: str, align?: str): put b under a, aligned “left” (default), “center” or “right”
"wide one".stack("x", "right")
# → wide one
# → x
See also: beside
overlay
overlay(a: str, b: str, x: int, y: int): draw b over a with its top-left at column x, row y; spaces in b are see-through
boxed(" ").overlay("hi", 2, 1)
# → ┌───────┐
# → │ hi │
# → └───────┘
See also: beside
mirror
mirror(s: str, axis?: str): flip left-right (“h”, default) or upside down (“v”), turning slashes and brackets to match
"(=^.^=)/".mirror
# → "\\(=^.^=)"
"/\\\n\\/".mirror("v")
# → /\
# → \/
rotate
rotate(s: str, degrees: int): turn art clockwise by 90, 180 or 270 degrees
"abc\ndef".rotate(90)
# → da
# → eb
# → fc
See also: mirror
scale
scale(s: str, n: int): make every character an n×n block of itself
"ab".scale(2)
# → aabb
# → aabb
See also: banner
negative
negative(s: str): swap ink and background: spaces become blocks, blocks and braille dots invert
"▀ █".negative
# → "▄█ "
See also: invert
trim_art
trim_art(s: str): drop blank lines at the ends, shared left indentation and trailing spaces
"\n ab\n c\n\n".trim_art
# → ab
# → c
See also: dedent
More examples
compose
# a caption under a picture
clipart("owl").stack("hoo?", "center")
# → ,_,
# → (O,O)
# → ( )
# → -"-"-
# → hoo?
# two friends
clipart("cat").beside(clipart("dog"), 4)
# → /\_/\ __ _
# → ( o.o ) o'')}____//
# → > ^ < `_/ )
# → (_(_/-(_/
# a cat says
cowsay("deploy on friday?", "cat")
# → ___________________
# → < deploy on friday? >
# → -------------------
# → \
# → \
# → /\_/\
# → ( o.o )
# → > ^ <
# a picture frame
clipart("house").boxed("double").boxed("shadow")
# → ┌──────────────┐
# → │ ╔══════════╗ │▒
# → │ ║ /\ ║ │▒
# → │ ║ / \ ║ │▒
# → │ ║ /____\ ║ │▒
# → │ ║ | [] | ║ │▒
# → │ ║ |_||_| ║ │▒
# → │ ╚══════════╝ │▒
# → └──────────────┘▒
# → ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
# a dark sky
starfield(20, 4, 1).negative
# → ████ █████ █ ███████
# → ██████████████ █████
# → █████ ██████ ██████