Claude Art

How it works

A real example, start to finish: Claude Sonnet 5.5 painting "The Oak above the Sea of Fog" at the easel. The example, its code and its pictures are from stillwet.art (CC BY 4.0), where the original author ran it. The paintings on this site are made the same way.

0pictures given to it
510blocks of code
8.7 hof painting

1. It starts with a short written brief, not a picture

This is the whole assignment. It names a painter's style and forbids reference pictures. The AI invents the scene.

Compose and paint one original landscape in the manner of Caspar David Friedrich, at the easel, a simulator of oil paint on linen. The place, subject and composition are yours to invent. Work from knowledge and the notes in your studio; don't use reference images, image models or pictures of his work.

It also gets text notes to read: the easel's manual, Friedrich's materials, how trees grow, oil paint physics. Then it plans in its head:

I'm picturing a composition: a dark rocky ledge in the foreground overlooking a fog-filled valley, with distant tabletop mountains catching the warm light of sunrise, a sky gradient from orange to pale blue-green to deep blue, a pair of spruces anchoring one edge, and a solitary figure...

2. The canvas is a grid of numbers

The canvas is 1000 units wide (714 tall here), counted from the top-left corner. Everything the AI does names positions on that grid. Its first move was a pencil drawing, every line given as a list of points:

h2 = pencil("HB")
-- oak skeleton (center lines)
trunk = {{242,532},{238,500},{240,470},{235,445},{236,428}}
L1    = {{236,430},{212,402},{186,380},{160,350},{140,318},{118,282},{96,246},{80,210},{70,170}}
L2    = {{236,430},{244,398},{258,365},{256,332},{246,300},{254,262},{266,226},{260,190},{268,150}}
...
h2:line(trunk, {pressure=0.3})

3. It mixes its own paint

Only from 14 old-master tubes, in parts, like a real palette:

skyTop  = pile{{"lead white",4},{"smalt",3},{"cobalt blue",1}, medium=0.25}
skyGlow = pile{{"lead white",6},{"chrome yellow",1},{"vermilion",0.15}, medium=0.2}

4. Two ways to put paint down

Big areas: it names a region, the tool plans the strokes. It describes a shape (rectangle, oval, curve, or a shape drawn from points), picks a brush and paint, and the easel lays hundreds of real brush strokes across it, the way a hand would.

-- fill a band of sky: the AI gives the area, the tool plans the strokes
work(rect(0, 100, 1000, 130), {hand="broad", pile=S2, angle=0.02, coverage=2.2})
-- a soft warm glow: an oval, blurred, glazed thinly
glowM = ellipse(620, 410, 430, 120):blur(60)
work(glowM, {hand="glaze", pile=S5, coverage=3, clip=true})

Small things: exact strokes. For a twig, the figure or a staff, it gives each point of each stroke, plus pressure.

-- the walking staff: one stroke, every point given
stf = brush{kind="rigger", width=2, point=1}
stf:load(figD, 1.0)
stf:stroke({{433.6,546},{432.8,531.5},{432,515.5},{431.4,501.5}}, {pressure={0.55,0.35}})

Most of the painting is the first kind, with exact strokes for details. Late in the painting it also wrote small programs that grow twigs along branches.

5. It looks, criticizes, and repairs

After most blocks it asks to see the canvas (whole, zoomed in, in grays, blurred, or mirrored) and gets a picture back. It can't undo, so fixes mean painting over. Right after the 30-minute picture below:

I'm noticing the stipple at the top created a hard opaque edge instead of the intended feathered fade... There's also a dark smear that looks like wet paint dragged from a branch in the oak's upper crown... I realize the sky mask never excluded the oak, so my rect painted straight over the oak's branches, creating a hard vertical edge at x=268 across the trunk and limbs... Now I need to repair this: I'll repaint the missing oak limbs directly over the sky layer.

6. The painting, stage by stage

Block 5
Block 5. Pencil lines (too faint to see here), a strip of test color swatches at the bottom, first sky bands.
Block 10
Block 10. Sky smoothed and glazed into a gradient.
Block 30
Block 30. Fog, a dark hill, the tabletop rock.
Block 60, 30 min in
Block 60, 30 min in. Oak drawn in. A sky pass went right over the branches (the pale block): the mistake it critiques below.
Block 100
Block 100. Twigs painted over while repairing; a hot orange band it later toned down.
Block 200
Block 200. Oak rebuilt as bigger limbs, ready for twigs.
Block 300
Block 300. Twigs, figure with staff, firs, grass.
Block 510, the end
Block 510, the end. Finished. It declared it done.