/procedural-art:procedural-paintingfrom Procedural Art
Paints original pictures from imagination using Python scripts that compose subjects with shapes, light, and color, then simulates real brush strokes with pigment mixing, dry bristles, wet-into-wet pickup, and impasto relief. Also records painting films and repaints existing images.
Ships in Procedural Art. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
You are the painter. scripts/atelier.py is the paint, the brushes and the canvas; the picture itself (what is in it, where the light comes from, what colour each thing is, which way the brush moves) is a Python script you write for this one painting. Nothing is sampled from an image and no model draws anything.
| Tool | Does | Time on 1 CPU |
|---|---|---|
scripts/sitting.py + scripts/atelier.py | An original painting of any subject, painted in sittings with a look at the canvas between them | 10 to 20 s per look at 1200×800 · 1 to 3 min for a 2400×1600 final |
scripts/stage.py | Sets the subject up as a small 3D scene (solids, posable figures, camera, light) and hands the painter a colour study, masks, depth and form-following brush directions | 10 to 16 s per render |
scripts/repaint.py | Repaints an existing image with the same paint; with --aov it paints a real mountain by its ground (fall lines, snow, water) | 15 s at 1800×600 |
scripts/fusain.py | Charcoal and graphite, a third medium: a stick on toothed paper, broad side strokes and tip lines, hatching along the form, smudging and lifting; drawn from a 3D stage so the strokes follow real form (see references/fusain.md) | about 30–60 s per study at 1600 px |
scripts/aquarelle.py | Watercolour, a second medium with its own simulation: transparent washes over white paper, wet-in-wet, hard edges that dry darker at the rim, granulation in the paper grain, dry brush (see references/aquarelle.md) | about 1 min at 2133×1600 |
scripts/motion.py | A painting that moves: a fixed-camera film (a sunset timelapse) painted with one set of strokes that hold still while the light changes | about 2.5 s per frame at 1200×400, frames in parallel |
scripts/tape.py | Exports the stroke list so the painting can paint itself live in a browser (docs/paint) | under 1 s |
Requirements: Python 3 with numpy, scipy and pillow; ffmpeg for the process film. Work in a writable folder and call scripts by path. In the commands below SK is this skill's folder and S=$SK/scripts.
Seven finished paintings live in studies/. Read one before writing your own: the_letter.py (3D stage: an interior, a seated figure, window light), the_white_cup.py (3D stage: a half-length figure at a table, face and hands), pomegranates_from_the_scene.py (the path tracer's scene file, painted), harbour_at_first_light.py (painted in sittings; limited palette, boats, water, drawn rigging), rain_at_blue_hour.py (night street, lamps, reflections, figures), lemons_and_blue_jug.py (still life, form and cast shadows), wind_over_the_barley.py (daylight landscape, clouds). Each runs as python $SK/studies/NAME.py --out out.png [--height 1600] [--film out.mp4] [--study study.png] [--tape out.tape].
Paint in sittings and look at the canvas after each one. The looking is the method: most of the quality comes from what you change after seeing the picture, so never write all the passes blind and render once.
python $S/sitting.py work/harbour --init 1200x800 --ground "#8a6f5a" --seed 5 # canvas.json + an empty study.py
python $S/sitting.py work/harbour # runs study.py and every sitting not yet run; writes look.jpg
study.py.study.py. With numpy, on the coordinate fields x (0 to aspect) and y (0 at the top to 1), compute study, one H×W×3 image of flat intended colour: gradients for sky and ground, shapes for objects (sd_circle, sd_ellipse, sd_box, sd_segment, sd_poly, sd_curve, lathe, joined with np.minimum or smin, turned into masks with fill), light and shadow from shade and cast_shadow, noise for variation. For anything that needs drawing (figures, interiors, streets, perspective, cast shadows) build the study on the 3D stage instead of by hand: sc = Scene(Camera(...), key=...), sc.add(name, shapes, colour), figure(sc, 'reader', at=..., pose='read'), B = sc.render(p); then B.study is the study, B.masks and B.flow are the masks and brush directions, and paint(p, B, focus='reader') lays it back to front (see references/stage.md and the_letter.py). Define here every mask and direction field the sittings will share. Run sitting.py and read look.jpg: fix drawing, values and colour now, where a change costs seconds. If the subject and the light don't read in the small grey panel, no brushwork will rescue it.10_lay_in.py, 20_sky.py, 30_water.py, ...), each a few p.strokes / p.mass / p.marks calls with a comment saying what the sitting is for. Back to front, big brush first: a thin lay-in over everything, then each mass with its own brush direction (sweeps across a sky, upright pulls down a wall, round a form, level across water). That direction per mass is what an image filter cannot do and is most of why the result reads as painted.sitting.py and read look.jpg after every sitting. It shows the canvas beside the study, both again small and grey (the squint test), and a map of where they differ; looks/NAME.jpg keeps the canvas after each sitting. Criticise it as a painter would (muddy sky? edges all the same? strokes poking over an outline? focal point lost?), then either edit that sitting's file and run again (only the changed sittings replay), or move on.thickness 2.5 and up, pickup near 0), p.dabs for single touches, p.marks for masts, posts, stems and branches.python $S/sitting.py work/harbour --final 1600 --out harbour.png --film harbour.mp4 replays every sitting at full size (sizes are fractions of the picture height, so the draft is the final seen smaller). Look at a 1:1 crop before showing it. --bundle harbour.py writes the whole painting as one standalone script.Names shared between sittings must be defined in study.py: it runs before every sitting, while earlier sittings are restored from a checkpoint and not run again. Give p.noise a seed in study.py so the study is the same on every run.
Tell the user what you decided in step 1 when you show the picture, and offer the film.
import sys; sys.path.insert(0, f"{SK}/scripts")
from atelier import *
p = Painting(1500, 1000, seed=3, ground='burnt sienna', film=False) # a toned canvas
x, y = p.x, p.y
study = ... # H x W x 3 sRGB in 0..1: the picture in flat colour
p.strokes(np.ones_like(x), blur(study, 20), flow=0.2, size=0.085, pickup=0, dry=0.35, thickness=0.35) # lay-in
p.mass(sky_mask, study, flow=sky_flow, sizes=(0.055, 0.028), length=7, pickup=0.55)
p.mass(jug_mask, study, flow=around(x, y, 0.7, 0.5), sizes=(0.03, 0.014, 0.006), clip=0.7, tol=0.05)
p.dry(0.6) # let it set before the clean top notes
p.strokes(highlight_mask, study, size=0.012, length=2.5, pickup=0.1, load=1.3, thickness=2.6)
p.marks([[(0.33, 0.18), (0.33, 0.80)]], '#14142a', size=0.008) # one pulled line
p.dabs([(0.4, 0.3)], 'titanium white', size=0.02, thickness=3) # one loaded touch
p.cut_in(objects_mask, study) # background painted back up to the outlines
p.save('out.png'); p.film('out.mp4') # film needs Painting(..., film=True)
p.strokes(mask, color, flow, size, ...) lays one pass of one brush size. color is the study (each stroke takes the colour under its start), a triple, a hex string or a pigment name. flow is the brush direction in radians, a number or an H×W field (around, along(field) to follow contour lines, across(field) to run downhill, or your own formula).p.mass(...) is the block-in plus refining passes: the first size covers the mask, later sizes go only where the canvas is still further than tol from the study.p.marks(lines, color, size) draws each polyline once, in order. curve(points) gives a smooth line through points. p.dabs(points, color, size, stretch) lays single round touches (petals and leaves with stretch above 1).size may be an H×W field, so strokes shrink into the distance in one pass: size=0.004 + 0.03 * near with gu, gv, near = ground_plane(x, y, horizon). p.ground_noise(horizon, ...) is noise lying on that ground.ellipsoid_normal and lathe (a jug, bottle or vase from its profile) give normals; shade(n, light, lit, half, core, refl) gives the light families; specular the highlight; cast_shadow a shadow lying on the table. flow_ellipse and flow_lathe are the brush directions for those forms.knife=True on any pass lays it with a palette knife (flat slabs, hard edges, ridges, skipped patches); Painting(knife=True) or --knife does the whole picture that way.Painting(palette=['yellow ochre', 'vermilion', 'ivory black', 'titanium white']) limits every colour on the brush to what those tubes can mix (that one is the Zorn palette). Three to six tubes give a picture an automatic harmony; p.gamut.project(study) previews the study through the palette.p.glaze(mask, color, strength) adds a transparent film (it darkens and tints, as a glaze does). p.dry(amount) stops later strokes dragging what is underneath.mix(a, b, t) mixes two colours as pigments, lerp blends as light (both take an H×W weight as it is; don't add a trailing axis), palette({'ultramarine': 2, 'burnt sienna': 1, 'titanium white': 3}) mixes tube colours by parts, rgb('cobalt blue') looks one up. p.noise(scale, octaves, seed) is smooth noise.Every parameter, the pigment list and how the simulator works: references/atelier.md.
overshoot lets strokes run past a mass (lost edges, background, distance); clip cuts them at the outline (found edges, the focal object). Use both in one picture; a painting with every edge crisp looks like a cut-out, every edge soft looks out of focus.tol; leave the corners at the block-in stage. density below 1 lets the layer beneath show through.pickup 0.5 to 0.7, soft 0.2: skies, water, reflections dragged straight down), dry over set paint where they sparkle (dry 0.3, low load: light on water, foliage against sky).sd_segment and sd_poly shapes, paint them late with small brushes and clip near 0.8, and keep them simple. A silhouette with one lit edge reads better than a detailed figure.clip=1 on the background mask. clip below 1 on the object alone leaves a hairy outline.along() of a shading field makes whorls and around() makes target rings. Build the direction by hand instead: tip to tip along a lemon, down the profile of a jug (see lemons_and_blue_jug.py).box with cut=box(...), set soft to 40 or more, and put an emit plane just outside the opening.thickness 0.3 to 0.8), lights loaded (2 to 3.5). The relief lighting does the rest.python $S/repaint.py --in render.png --out painted.png --height 1600 [--looseness 1.3] [--film process.mp4]
The image supplies the colours; brush direction follows its edges. This is the quick way to put a photo or a render on canvas with pigment mixing and relief. It has no idea what the objects are, so a composed study script will always look more intended.
A real mountain painted by its ground: render it with procedural-realism's pbr_terrain.py ... --aov, post it, then pass the aov folder inside the band folder. The sky is swept in as one mass, slopes are painted with strokes running down the fall lines, plains level, snow late and thick, water dragged straight down and cut across, and the skyline is cut in. --push (default 1 here) is the painter's eye: more chroma, warmer lights, cooler shadows. --geom (depth only) remains for renders made with --geom-cache and no --aov.
R=/path/to/procedural-realism/scripts
python $R/pbr_terrain.py --peak 39.7019,44.2986 --from 40.1792,44.4991 --work work/ararat --size 2400x1000 --sun-el 6 --aov
python $R/post_terrain.py --bands work/ararat/bands_2400x1000 --out ararat.png
python $S/repaint.py --in ararat.png --aov work/ararat/bands_2400x1000/aov --out ararat_oil.png --height 1000
python $S/motion.py --frames work/tl/frames_HASH --aov work/tl/bands_1200x400_aov/aov --out sunset_oil.mp4 --keys 9
# for the browser easel: a looser cut as a stroke tape plus a sheet of the film's light (keep it near 40k strokes)
python $S/motion.py --frames work/tl/frames_HASH --aov work/tl/bands_1200x400_aov/aov --out web.mp4 --every 10 --keys 5 --looseness 1.9 --tape sunset.tape
--frames is a folder of frames from a fixed camera: a procedural-realism timelapse (timelapse.py leaves them in <work>/frames_<hash>), or any numbered image sequence. Painting each frame separately would make the brushwork boil, so the film is painted as one canvas: the first frame is painted in full and every stroke is remembered; at --keys frames spread over the film the same strokes are laid again in that frame's colours and the painter adds only what they cannot show there (a shadow edge that moved, lamps that came on, stars); then every frame is the whole set of strokes laid again, in the same order on the same weave, in that frame's colours. Lights are laid only while their spot is lit. --aov (buffers of the same view from pbr_terrain.py --aov, at the frame size) makes the first frame a terrain-aware painting. More --keys follow fast changes better and cost a few seconds each.
For the buffers of a timelapse view, render one more frame with the same view flags as after the -- of the timelapse command, plus --sky physical --geom-cache --size WxH --tag aov --aov, into the same --work.
In your own script the pieces are Painting(..., tape='full'), p.replay(tape, study) (the same strokes with colours taken from another study) and fade=True on passes that paint lights.
When the user asks for a charcoal, graphite or pencil drawing, use scripts/fusain.py. Draw the subject part by part: s.mass(outline, ...) models each part's tone from a hand-placed outline, Part.tufts lays fur in curved locks, s.between hatches across a form between two guide curves, and s.digit, s.feather and s.eye draw toes, feathers and eyes, back to front. A subject built on the 3D stage can instead be drawn with draw_subject(sheet, B, mask, ...). Read references/fusain.md and one of studies/sketch_dog.py, sketch_frog.py, sketch_crow.py first. Its limits: anatomy is only as good as the outlines you place, so animals take several rounds of looking, and next to the best answers on the comparison page its parts read smoother and rounder than a practised hand would draw them.
When the user asks for watercolour, use scripts/aquarelle.py instead of the oil engine: from aquarelle import *, p = Paper(W, H, seed=1). The order is the medium's own: light to dark, whites are paper left bare, a wash on wet paper has no edge and a wash on dry paper keeps one. p.wet(mask), p.wash(mask, color, strength), p.drop(points, color) (charge colour or clean water into a wet wash), p.stroke(lines, color, size, dry=...), p.dry() between layers, p.save(out). Read references/aquarelle.md and one of studies/estuary_in_watercolour.py (wet sky, granulating hills, dry-brush water) or studies/poppies_in_watercolour.py (transparent petal layers) first. To paint an existing picture or a terrain render as a watercolour: python $S/aquarelle_repaint.py --in ararat.png --out ararat_wc.png [--aov work/ararat/bands_2400x1000/aov] [--height 1000] [--border 0]. Its limits: the mottling inside a wash is soft at 1:1, the dry-brush accents suggest a slope more than draw it, and without --aov a mountain is split into planes by tone alone.
Every study takes --tape FILE (and sitting.py --final ... --tape FILE): the stroke list in a 0.7 to 2 MB file. The page in docs/paint holds a JavaScript port of the simulator and lays the strokes again live, at any size, with a movable light. It is not a video. To add a painting there, export to docs/paint/tapes/NAME.tape and add { id: 'NAME', title: '...' } to PAINTINGS in docs/paint/app.js. In your own script: Painting(..., tape=True), then from tape import save_tape; save_tape(p, 'x.tape', title='...').
Say so when a request lands here.
atelier.py), watercolour (aquarelle.py) and charcoal (fusain.py). For gouache or ink finishes of an existing image use paint.py in procedural-realism.references/aquarelle.md (opens in a new tab)references/atelier.md (opens in a new tab)references/fusain.md (opens in a new tab)references/stage.md (opens in a new tab)scripts/aquarelle.py (opens in a new tab)scripts/aquarelle_repaint.py (opens in a new tab)scripts/atelier.py (opens in a new tab)scripts/fusain.py (opens in a new tab)scripts/motion.py (opens in a new tab)scripts/repaint.py (opens in a new tab)scripts/sitting.py (opens in a new tab)scripts/stage.py (opens in a new tab)scripts/tape.py (opens in a new tab)studies/estuary_in_watercolour.py (opens in a new tab)studies/harbour_at_first_light.py (opens in a new tab)studies/lemons_and_blue_jug.py (opens in a new tab)studies/pomegranate.json (opens in a new tab)studies/pomegranates_from_the_scene.py (opens in a new tab)studies/poppies_in_watercolour.py (opens in a new tab)studies/rain_at_blue_hour.py (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
4 skills in this plugin
/procedural-canvasPaint a whole landscape or scene as ONE self-contained HTML file that draws itself in the browser with Canvas 2D and plain JavaScript, with no images, no libraries, no network and no generative image model. Use this when the user asks for a single HTML file, an HTML5 Canvas or vanilla JavaScript picture, a "procedural" or "every pixel computed" scene that must run offline in a browser, or a web page or artifact that renders a photorealistic or painterly landscape (mountains, lakes, forests, sea, ruins, skies) by code. You build a small renderer for that one picture (world-space terrain, linear-light water with reflection and refraction, trees, clouds, light shafts, a restrained grade), give it a seed, and check it by rendering headless and looking. It can bake real elevation data into the file so the mountain is the real one. Not for Python renders or prints of real terrain (procedural-terrain-art, procedural-realism) or for oil and watercolour simulation (procedural-painting)./procedural-realismMake photographic-style images with pure code and physics, no generative image model. Ray-marched terrain of any real mountain with physical sky, haze, shadows, snow, mist and clouds; mirror lakes; forests and villages; blue hour with a lit city or a moonlit starry night; sunset timelapse videos along the real sun path. A from-scratch path tracer renders JSON still lifes (glass, prisms with rainbow caustics, copper, fruit). A painterly finisher turns any image, including an uploaded photo, into oil, impasto, gouache, watercolour or ink. Use whenever someone wants a realistic or "CGI" render made from code, a photoreal landscape of a real place, a 3D still life without Blender, a painting of a render or photo, or an image path traced or ray traced from scratch with "no AI image". Not for help with other renderers (Blender, Cycles, Unreal), explaining rendering in words, photo filters or real-paint advice. For line-art, contour, riso or woodcut styles, use procedural-terrain-art.npx claudepluginhub dogum/procedural-art --plugin procedural-artOther plugins' skills for the same job