Skip to content

art.frames

arrange text pictures: boxes and speech bubbles, side by side, stacked, overlaid, flipped, rotated, scaled

Frames treat a text picture as a block of lines. You can put a box or speech bubble around one, set two side by side or stack them, lay one over another, and flip, rotate or scale the result.

Tags: art

  • boxed draw a box around text
  • say a clip art picture saying s in a speech bubble: the cow, or any clipart() name
  • cowsay the same as say, named after the classic Unix program
  • think like say, but in a thought bubble
  • beside put picture b to the right of picture a, tops lined up, with gap spaces between
  • stack put picture b under picture a, lined up “left”, “center” or “right”
  • overlay draw picture b on top of picture a, with b’s top-left corner at column x and row y of a (counting from 0)
  • mirror flip a picture left to right (“h”) or upside down (“v”)
  • rotate turn a picture clockwise by 90, 180 or 270 degrees
  • scale make a picture n times bigger by repeating each character n times across and n times down
  • negative swap ink and background: spaces become solid blocks and the other way round, and braille dots are inverted
  • trim_art remove blank lines at the top and bottom, indentation every line shares, and spaces at the ends of lines
boxed(s: str, style: str = “single”) -> str

draw a box around text

style is “single”, “double”, “round”, “heavy”, “ascii”, “stars” or “shadow”

1
boxed("hello")
┌───────┐ │ hello │ └───────┘
2
"zil\ncalc".boxed("round")
╭──────╮ │ zil │ │ calc │ ╰──────╯
Example outputCtrl+Enter to run

See also say, stack

say(s: str, art: str = “cow”) -> str

a clip art picture saying s in a speech bubble: the cow, or any clipart() name

1
say("moo")
_____ < moo > ----- \ \ (__) (oo) /-------\/ / | || * ||----|| ~~ ~~
2
say("pika", "pikachu")
______ < pika > ------ \ \ (\__/) (o^.^o) z(_(")(")
Example outputCtrl+Enter to run

See also think, cowsay, boxed

cowsay(s: str, art: str = “cow”) -> str

the same as say, named after the classic Unix program

1
cowsay("moo")
_____ < moo > ----- \ \ (__) (oo) /-------\/ / | || * ||----|| ~~ ~~
Example outputCtrl+Enter to run

See also say

think(s: str, art: str = “cow”) -> str

like say, but in a thought bubble

1
think("hmm", "ghost")
_____ ( hmm ) ----- o o .-. (o o) | O \ \ \ `~~~'
Example outputCtrl+Enter to run

See also say

beside(a: str, b: str, gap: int = 1) -> str

put picture b to the right of picture a, tops lined up, with gap spaces between

1
"a\nb".beside("c\nd\ne")
a c b d e
Example outputCtrl+Enter to run

See also stack, overlay

stack(a: str, b: str, align: str = “left”) -> str

put picture b under picture a, lined up “left”, “center” or “right”

1
"wide one".stack("x", "right")
wide one x
Example outputCtrl+Enter to run

See also beside

overlay(a: str, b: str, x: int, y: int) -> str

draw picture b on top of picture a, with b’s top-left corner at column x and row y of a (counting from 0)

Spaces in b let a show through

1
boxed(" ").overlay("hi", 2, 1)
┌───────┐ │ hi │ └───────┘
Example outputCtrl+Enter to run

See also beside

mirror(s: str, axis: str = “h”) -> str

flip a picture left to right (“h”) or upside down (“v”)

Slashes and brackets are swapped so the shapes still look right

1
"(=^.^=)/".mirror"\\(=^.^=)"
2
"/\\\n\\/".mirror("v")
/\ \/
Example outputCtrl+Enter to run

See also rotate, flip

rotate(s: str, degrees: int) -> str

turn a picture clockwise by 90, 180 or 270 degrees

1
"abc\ndef".rotate(90)
da eb fc
Example outputCtrl+Enter to run

See also mirror

scale(s: str, n: int) -> str

make a picture n times bigger by repeating each character n times across and n times down

1
"ab".scale(2)
aabb aabb
Example outputCtrl+Enter to run

See also banner

negative(s: str) -> str

swap ink and background: spaces become solid blocks and the other way round, and braille dots are inverted

1
"▀ █".negative"▄█ "
Example outputCtrl+Enter to run

See also invert

trim_art(s: str) -> str

remove blank lines at the top and bottom, indentation every line shares, and spaces at the ends of lines

1
"\n ab\n c\n\n".trim_art
ab c
Example outputCtrl+Enter to run

See also dedent

1
# a caption under a picture
2
clipart("owl").stack("hoo?", "center")
,_, (O,O) ( ) -"-"- hoo?
3
# two friends
4
clipart("cat").beside(clipart("dog"), 4)
/\_/\ __ _ ( o.o ) o'')}____// > ^ < `_/ ) (_(_/-(_/
5
# a cat says
6
say("deploy on friday?", "cat")
___________________ < deploy on friday? > ------------------- \ \ /\_/\ ( o.o ) > ^ <
7
# a picture frame
8
clipart("house").boxed("double").boxed("shadow")
┌──────────────┐ │ ╔══════════╗ │▒ │ ║ /\ ║ │▒ │ ║ / \ ║ │▒ │ ║ /____\ ║ │▒ │ ║ | [] | ║ │▒ │ ║ |_||_| ║ │▒ │ ╚══════════╝ │▒ └──────────────┘▒ ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
9
# a sky of black stars on white
10
starfield(20, 4, 1).negative
████ █████ █ ███████ ██████████████ █████ █████ ██████ ██████
Example outputCtrl+Enter to run

Example results generated on 2026-11-04. Ones using now, today or randomness will differ when you run them.