Claude paints with code: a Claude Code skill for procedural illustration in 83 styles, from ink wash (水墨), watercolour and ukiyo-e to stained glass, Roman mosaic, Art Deco, shadow puppets, pastel UI, sketchbook doodles, spot illustrations, grainy picture books, dreamy hills, sunlit greenery. No image model: numpy + Pillow on a CPU, draw-on GIFs.
Python agent-skillsanimechinese-paintingclaudeclaude-codeclaude-skillscolored-pencilcreative-codingcross-stitcheditorial-illustrationgenerative-artink-wash-paintingoil-paintingpaper-collagepixel-artprocedural-generationrisographshanshuiukiyo-ewatercolor
Add oil pastel portrait style (78 total): something warm to hold
cloveric4220b2d8b361
diff --git a/README.md b/README.mdindex 94f183b..c983c1d 100644--- a/README.md+++ b/README.md@@ -1,7 +1,7 @@# Claude Drawing · Claude 绘图-**Claude paints with code — no image model.** Seventy-seven styles, from ink wash and impasto oil to clay, cyanotype, stained glass, a Roman mosaic, Delft tiles, a cyberpunk street, a ray-traced ball pit, low-poly 3D, a thermal camera, an X-ray, a VHS tape, a synthwave sunset, a pastel product-film UI, an answer sheet marked in red, a lamp-lit shadow-puppet play, pen-and-wash sketch cards, retro gouache picture-book portraits, a soft-blue picture-book spread, a Jiangnan water garden in spring, a dry-brushed mid-century poster, a dusk picture-book page where the sky turns to stars, a hatched night print of lava meeting the sea, a dark note-taking app rendering its diagram, an infinite canvas of cards, a five-diagram sheet on warm Flexoki paper, a warm coloured-pencil storybook spread, a colour town of gouache houses strung with bunting, a soft-pastel vignette of a woman wearing her ginger cat as a scarf and a melancholic Halloween portrait of a porcelain-faced child carrying a glowing ghost home in a jar.-**不用生图模型,Claude 用代码一笔一笔作画。** 七十七种画风,从水墨、油画到黏土、蓝晒、彩色玻璃花窗、罗马马赛克、代尔夫特蓝瓷砖、赛博朋克、光线追踪的小球海、低多边形 3D、热成像、X 光片、VHS 录像带、Synthwave 落日、产品发布片式的粉彩界面、红笔批改的答题卡、油灯下的皮影戏、钢笔淡彩的速写小卡、复古水粉的绘本大头像、蓝调绘本的雨天跨页、江南园林的春水园景、干刷色块的 mid-century 海报、暮色微缩绘本里转入星空的黄昏、排线夜景里流进海里的熔岩、深色笔记应用里渲染出的流程图、卡片铺开的无限白板、Flexoki 暖纸上的五图图解、暖调彩铅叠出来的绘本跨页、挂满彩旗的水粉彩色小镇、把橘猫当围巾的色粉小像和捧着罐中小幽灵的诗意万圣夜。+**Claude paints with code — no image model.** Seventy-eight styles, from ink wash and impasto oil to clay, cyanotype, stained glass, a Roman mosaic, Delft tiles, a cyberpunk street, a ray-traced ball pit, low-poly 3D, a thermal camera, an X-ray, a VHS tape, a synthwave sunset, a pastel product-film UI, an answer sheet marked in red, a lamp-lit shadow-puppet play, pen-and-wash sketch cards, retro gouache picture-book portraits, a soft-blue picture-book spread, a Jiangnan water garden in spring, a dry-brushed mid-century poster, a dusk picture-book page where the sky turns to stars, a hatched night print of lava meeting the sea, a dark note-taking app rendering its diagram, an infinite canvas of cards, a five-diagram sheet on warm Flexoki paper, a warm coloured-pencil storybook spread, a colour town of gouache houses strung with bunting, a soft-pastel vignette of a woman wearing her ginger cat as a scarf, a melancholic Halloween portrait of a porcelain-faced child carrying a glowing ghost home in a jar and an oil-pastel portrait of a woman warming her hands on a paper cup on a winter morning.+**不用生图模型,Claude 用代码一笔一笔作画。** 七十八种画风,从水墨、油画到黏土、蓝晒、彩色玻璃花窗、罗马马赛克、代尔夫特蓝瓷砖、赛博朋克、光线追踪的小球海、低多边形 3D、热成像、X 光片、VHS 录像带、Synthwave 落日、产品发布片式的粉彩界面、红笔批改的答题卡、油灯下的皮影戏、钢笔淡彩的速写小卡、复古水粉的绘本大头像、蓝调绘本的雨天跨页、江南园林的春水园景、干刷色块的 mid-century 海报、暮色微缩绘本里转入星空的黄昏、排线夜景里流进海里的熔岩、深色笔记应用里渲染出的流程图、卡片铺开的无限白板、Flexoki 暖纸上的五图图解、暖调彩铅叠出来的绘本跨页、挂满彩旗的水粉彩色小镇、把橘猫当围巾的色粉小像、捧着罐中小幽灵的诗意万圣夜和冬天早上捧着一杯热饮的油画棒肖像。[English](#english) · [中文](#中文)@@ -58,8 +58,8 @@|  |  |  || **Warm pencil storybook · 暖调彩铅绘本** | **Pastel vignette · 色粉小像** | **Poetic Halloween · 诗意万圣夜** ||  |  |  |-| **Ink wash · 水墨(月印万川)** | **Watercolour · 水彩(底纹)** | |-|  |  | |+| **Oil-pastel portrait · 油画棒肖像** | **Ink wash · 水墨(月印万川)** | **Watercolour · 水彩(底纹)** |+|  |  |  |<p align="center"><img src="examples/drawing_colortown_festival_steps.gif" width="45%"><br><sub><b>Colour town · 彩色小镇</b> — portrait 3:4 · 竖幅</sub></p>@@ -145,10 +145,10 @@| <img src="examples/flexoki_pour_over.jpg" width="100%"> | <img src="examples/pencilbook_tortoise_crossing.jpg" width="100%"> || **雨后的节日台阶街** · *Festival Steps After the Rain*<br><sub>Colour town · 彩色小镇</sub> | **橘猫围巾** · *The Marmalade Scarf*<br><sub>Pastel vignette · 色粉小像</sub> || <img src="examples/colortown_festival_steps.jpg" width="100%"> | <img src="examples/pastelvignette_marmalade_scarf.jpg" width="100%"> |-| **罐子里的小幽灵** · *The Ghost in the Jar*<br><sub>Poetic Halloween · 诗意万圣夜</sub> | |-| <img src="examples/poetichalloween_ghost_jar.jpg" width="100%"> | |+| **罐子里的小幽灵** · *The Ghost in the Jar*<br><sub>Poetic Halloween · 诗意万圣夜</sub> | **捧着一杯热的** · *Something Warm to Hold*<br><sub>Oil-pastel portrait · 油画棒肖像</sub> |+| <img src="examples/poetichalloween_ghost_jar.jpg" width="100%"> | <img src="examples/oilpastel_warm_cup.jpg" width="100%"> |-Every mark above is computed: paper fibres, ink washes and mist, dry-brush strokes, pigment granulation and blooms, torn-paper edges, pencil wax on paper tooth, cel-shaded clouds, risograph grain and halftones, lit impasto relief, woodblock grain and bokashi, dithered pixels, plasticine lit like a film set, sunlight through leaves on Prussian blue, twisted thread on Aida cloth, machined knobs behind a backlit dial, die-cut vinyl with a laminate gloss, streaky thermal print, graphite catching the tooth of graph paper, highlighter pooling at the start of a swipe, chalk dust settling under half-erased lessons, rain-lit neon glass mirrored in a wet street, a blue-pencil rough under boiling brush ink, an island ray-traced under one soft sun, a single unbroken gold line, candy balls with softbox glints, one outline morphing through six shapes, halftone photos cut out with scissors, frosted glass blurring the real pixels behind it, screen-printed primaries out of register, a slit sun sinking behind a neon grid played off tape, hollow fuse beads on a pegboard melting together under an iron, pits knocked through desert varnish, a red grid showing through flaking plaster, stones laid row by row along an outline, daylight through leaded glass, burnished gold that mirrors the room, left-handed hatching in iron-gall ink, black paper cut with scissors, wood type printed a hair out of register, red and black plates slipping apart, airbrush fades inside knife-cut friskets, Ben-Day dots on yellowed newsprint, one photo key pulled across hand-painted colour, characters struck through a fading ribbon, flat-shaded triangles dithered to 15 bits, spray drifting past cut card, satin stitches catching the light by their angle, ink lines printed white on Prussian blue, wax scribbles skipping the paper's pits, phosphor glowing behind curved glass, heat leaking out of a kitchen, cobalt fired into tin glaze tile by tile, ochre blown onto rock lit by a fire, 1-bit patterns in an old paint program, slip silhouettes incised to the clay, graphite that never quite reaches black, X-rays adding up through a suitcase, grey cels shot on scratched film, gouge marks in a rolled-up block, a birthday smeared onto tape, seven flat colours lifting off each other, an acorn squashing and stretching through a world drawn as it goes, ballpoint ink blobbing at every corner of a hand-drawn game, inks multiplying through tracing paper on a light box, window cards floating on a pastel field over shadows tinted by it, a vermilion stamp running dry at one end, red ink pooling where the pen slowed down, dyed donkey hide glowing on a lamp-lit screen, gouache scumbled dry over a toned board, knit stitch by stitch, dry pastel blue under a scratchy brush line, with chalk rain on top, a spring garden built leaf by leaf, its tiled roofs and willows mirrored in a jade lake, a roller and a dry brush running out across cream paper, a dusk sky going over to stars above thousands of tiny wildflowers, a night sea laid stroke by stroke under the one warm light of lava meeting the water, a hill town of gouache houses, inked line by line and slate by slate, strung with bunting and mirrored in a wet square, a woman and her cat in soft pastel, the faces rubbed smooth, the hair and fur laid strand by strand, the coat breaking up into dry strokes on white paper, and a porcelain child flushed red round the eyes, her burlap hat woven thread by thread, carrying a ghost whose glow warms the wool and the leaves. No diffusion model, no API, no stock art. It is just Python with **numpy + Pillow** on a CPU: from 0.1 s (pixel art) to about 45 s (the soft 3D ray tracer) per 1920×1080 image.+Every mark above is computed: paper fibres, ink washes and mist, dry-brush strokes, pigment granulation and blooms, torn-paper edges, pencil wax on paper tooth, cel-shaded clouds, risograph grain and halftones, lit impasto relief, woodblock grain and bokashi, dithered pixels, plasticine lit like a film set, sunlight through leaves on Prussian blue, twisted thread on Aida cloth, machined knobs behind a backlit dial, die-cut vinyl with a laminate gloss, streaky thermal print, graphite catching the tooth of graph paper, highlighter pooling at the start of a swipe, chalk dust settling under half-erased lessons, rain-lit neon glass mirrored in a wet street, a blue-pencil rough under boiling brush ink, an island ray-traced under one soft sun, a single unbroken gold line, candy balls with softbox glints, one outline morphing through six shapes, halftone photos cut out with scissors, frosted glass blurring the real pixels behind it, screen-printed primaries out of register, a slit sun sinking behind a neon grid played off tape, hollow fuse beads on a pegboard melting together under an iron, pits knocked through desert varnish, a red grid showing through flaking plaster, stones laid row by row along an outline, daylight through leaded glass, burnished gold that mirrors the room, left-handed hatching in iron-gall ink, black paper cut with scissors, wood type printed a hair out of register, red and black plates slipping apart, airbrush fades inside knife-cut friskets, Ben-Day dots on yellowed newsprint, one photo key pulled across hand-painted colour, characters struck through a fading ribbon, flat-shaded triangles dithered to 15 bits, spray drifting past cut card, satin stitches catching the light by their angle, ink lines printed white on Prussian blue, wax scribbles skipping the paper's pits, phosphor glowing behind curved glass, heat leaking out of a kitchen, cobalt fired into tin glaze tile by tile, ochre blown onto rock lit by a fire, 1-bit patterns in an old paint program, slip silhouettes incised to the clay, graphite that never quite reaches black, X-rays adding up through a suitcase, grey cels shot on scratched film, gouge marks in a rolled-up block, a birthday smeared onto tape, seven flat colours lifting off each other, an acorn squashing and stretching through a world drawn as it goes, ballpoint ink blobbing at every corner of a hand-drawn game, inks multiplying through tracing paper on a light box, window cards floating on a pastel field over shadows tinted by it, a vermilion stamp running dry at one end, red ink pooling where the pen slowed down, dyed donkey hide glowing on a lamp-lit screen, gouache scumbled dry over a toned board, knit stitch by stitch, dry pastel blue under a scratchy brush line, with chalk rain on top, a spring garden built leaf by leaf, its tiled roofs and willows mirrored in a jade lake, a roller and a dry brush running out across cream paper, a dusk sky going over to stars above thousands of tiny wildflowers, a night sea laid stroke by stroke under the one warm light of lava meeting the water, a hill town of gouache houses, inked line by line and slate by slate, strung with bunting and mirrored in a wet square, a woman and her cat in soft pastel, the faces rubbed smooth, the hair and fur laid strand by strand, the coat breaking up into dry strokes on white paper, a porcelain child flushed red round the eyes, her burlap hat woven thread by thread, carrying a ghost whose glow warms the wool and the leaves, and a winter coat laid in with dry oil-pastel strokes that skip the paper's tooth and run out in a comb of wax. No diffusion model, no API, no stock art. It is just Python with **numpy + Pillow** on a CPU: from 0.1 s (pixel art) to about 45 s (the soft 3D ray tracer) per 1920×1080 image.---@@ -156,7 +156,7 @@ Every mark above is computed: paper fibres, ink washes and mist, dry-brush strok### What it is-A [Claude Code](https://claude.com/claude-code) skill and a small painting library with seventy-seven styles:+A [Claude Code](https://claude.com/claude-code) skill and a small painting library with seventy-eight styles:| Style | Module | What makes it read as the real medium ||---|---|---|@@ -237,6 +237,7 @@ A [Claude Code](https://claude.com/claude-code) skill and a small painting libra| **Colour town (彩色小镇)** | `lib/colortown.py` · `ColorTown` | a dense, cheerful storybook hill town in opaque gouache and a fine ink line — tall narrow houses in tomato, mustard, teal, mint, coral and cream piled up a slope under blue-grey slate mansards, a white clock tower, strings of bunting across the street at several depths, climbing roses, window boxes and a wet square that mirrors it all. Every coat of colour is a polygon: tens of thousands are filled at once, each with its own id, into a 2× supersampled integer map, and numpy looks every id up in a table of colour, alpha and texture weights and box-averages back to pixels, so edges are anti-aliased and painter's order is id order. Three fields precomputed for the whole canvas — vertical brush streaks, horizontal streaks and an isotropic scumble — plus a low mottle vary each coat by a few percent: walls are mostly scumble with a little vertical brushwork, the sky and the paving horizontal, and light colours get less of it, so a white wall stays clean. Edges are resampled and pushed sideways by a smooth wobble, so nothing is ruler-straight and the colour never quite registers with its line. The ink is a dark warm brown laid after each group's colour. Every line is its own id in a 3× map (no beads where lines cross), split into pieces of slightly different width, and the corners of boxes are separate strokes that sometimes overshoot. The ink is half-transparent, so it reads red-brown on a red wall and near-black on glass. `house()` builds a townhouse from a few numbers. The walls are plaster with bare-stone patches, string courses and a cornice, a thin glaze toward the foot and a band of shade under the eaves. The ground floor is a door, a shopfront with lettering and a striped awning, or an archway. Above it sits a grid of windows that are each a little different: cream frames, dark teal glass with a pale reflection, glazing bars, sills, slatted shutters on some and curtains on others. Window boxes overflow with leaves and flower dabs, and iron balconies hold pots. Then comes the roof: slate laid tile by tile in staggered courses, each slate its own blue-grey, clipped to the roof with the joints inked, as a mansard, hip, side gable or pointy gable, with dormers, chimneys with pots and TV aerials. `plane()` lays a flat facade onto a quad through a homography, so a whole canyon wall recedes to the vanishing point with its windows, boxes and roses. Depth is haze, scale and overlap, painted back to front; there are almost no cast shadows. Roses are irregular cups with a darker heart and inked petal arcs among paired leaves; trees are clumps of leaf dabs, each lit as a dome from the upper left; bunting sags as a parabola, with pennants hanging off it that each have a darker fold. The wet street mirrors the picture about each column's base line, rippled and smeared down more the further it gets, darkened and streaked into pale flagstones, with the joints re-inked on top; `mirror()` reflects whatever is painted after it (people, a lamp post). It comes with a clock tower with an onion dome and a louvred belfry, steps that shrink as they climb, parapets, railings, lamps, hanging signs, posters, café tables, a cat and small faceless people || **Pastel vignette (色粉小像)** | `lib/pastelvignette.py` · `PastelVignette` | a whimsical picture-book vignette in soft chalk pastel and a little gouache on pure white paper — a person and an animal companion, half-length, with no background panel and no frame: the painting simply stops and its edges break up into the white in dry strokes. The colour is soft and powdery (powder blue, cream, warm skin) with one warm accent family (ginger, tangerine); faces are rubbed smooth, with big round eyes, very large rosy cheeks and a red-tipped nose; hair and fur are hundreds of fine strands. The paper has an equalised tooth, and the same tooth is pre-dragged along 8 directions (stored as uint8), so pastel catches where the tooth rises above 1 − pressure and the pits it skips are drawn out along each stroke. Every *segment* of every stroke gets its own id in a 2× supersampled integer map, and numpy looks each covered sub-pixel up to its segment. From there it recovers the position along the stroke, for a pressure profile with rounded ends, and across it, for soft sides and bristle lanes that open up as the stroke runs dry. Pigment is laid where the pressure reaches the tooth and summed back with bincount, so tens of thousands of strokes cost about one Pillow line per segment. Pastel is nearly opaque, so pale dry strokes sit on a darker coat. `wash()` is pastel rubbed in with a finger: a smooth coat whose colour can come from a light field, with the deepest pits left a touch lighter and an edge that breaks into the tooth. `model()` washes a dark → light ramp over a soft dome light. A coat fades out through a smooth field, and its dry strokes run on past it, drying out pixel by pixel. `strands()` traces hair through a flow field and groups it into locks that share a root area, a wander, a curl and a shade; it paints dark first and lets a few fly loose. `fur()` lays tufts that are darker on the side away from the light, and `fluff()` grows short strands out of a silhouette, coloured from the paint just inside, so fur melts into what is behind it. Faces come from `eye()` (an off-white ball shaded blue-grey under the lid, a rayed iris with a pupil and two catchlights, a soft lid line flicking out at the outer corner), `blush()`, `nose()` (a side shadow and a red tip), `mouth()` and `brow()`. It also has a faint pencil line for background sketches, and leaves and sprigs || **Poetic Halloween (诗意万圣夜)** | `lib/poetichalloween.py` · `PoeticHalloween` | a melancholic, slightly surreal picture-book portrait for an autumn night, in opaque gouache and fine pencil hatching on a dark toned board, then printed. Faces are pale porcelain with a strong red flush on the nose, the cheeks and the lids and round the eyes, heavy half-closed sad eyes, a small unsmiling mouth and very simplified volumes. The hair is one sculpted mass — a blunt jet-black bob with a dead-straight fringe and a soft sheen. The cloth is tactile (burlap and felt hats, chunky knits, tartan), the ground is dark (night indigo, stars, dense leaves), and there is one luminous accent: little sheet-ghosts with glowing eyes and glowing fringe tips. Strokes use the same per-segment id map as the pastel vignette (wide for dry gouache, thin and long for hatching), and `colour='canvas'` lets each stroke take the colour under its centre, which repaints a computed base (a tartan, a modelled face, the sky) by hand without changing its colour. `model()` washes a dark → light ramp over a soft dome light, which gives the simplified volumes. `sheen()` lays a soft band where that light falls in a narrow range, then streaks it along the hair with a few long faint strokes, so the bob stays one mass. `eye()` is a heavy-lidded almond: the lid covers about half the iris and droops at the outer corner, with a dark lid line, a red wet rim on the lower lid and, optionally, the warm glint of a light below. `flush()` is a smooth red glaze plus a stipple of single specks that gets denser as the flush gets stronger, and `nose()` is its own small volume with a red tip. `burlap()` is a plain weave of slubby threads, each row and column with its own thickness, wandering a little and going over and under. It is lit as a height field, with dark holes, loose fibres and a frayed edge, and it can follow a curve. `knit()`, `rib()` and `tartan()` (a mirrored sett woven 2/2 twill over the light of the folds) cover the rest of the cloth. `leaf()` is a broad, double-serrated palmate leaf, foreshortened and folded along its midribs; it casts a soft shadow on the leaves behind, and that is where a hedge's depth comes from. Warm point lights fall off steeply, and `illuminate()` lights what is already painted as 1 − (1 − C)·exp(−L·receptivity·(base + albedo·C)), so wool and porcelain warm up a lot, leaves near a ghost turn olive-orange and black hair barely changes. `ghost()` is a translucent dome-and-bell of silver strands that falls from the crown like hair, with glowing eyes and a bead of light at the end of every lock. Bloom, a fine print grain and a coarser printed tooth that shows in the darks are added in `render()` |+| **Oil-pastel portrait (油画棒肖像)** | `lib/oilpastel.py` · `OilPastel` | a figure drawn with oil pastels (wax crayons) on white, toothy cold-press paper and left floating as a vignette — no background, at most a smear of sky or a dry-brushed cast shadow. The palette is tight and high-chroma: saffron and marigold, a teal navy and black, one cool blue, orange blush and red-orange lips. Big masses (a coat, a scarf, a hat) are laid in with parallel dry strokes of a constant-width stick; the wax catches on the peaks of an equalised paper tooth and skips the pits, so every mass is peppered with crisp white specks pulled into streaks along the stroke (the tooth is pre-dragged along 8 directions). The stick's worn face is split into lanes, each with its own pressure, value and end, so a stroke starts blunt and full and ends in a hard comb of uneven teeth; `spill` lets strokes run out past a shape by a different distance along every stretch of its edge. Black crayon (`crayon()`: a wobbling line in overlapping pieces of different weight) is kept for the eyes, brows, a nostril and a few contour and fold marks. Faces are the paper itself with peach on the shadow side, hatched orange `blush()` patches, flat `lips()` and heavy-lidded black `eye()`s; hair is a few long tapering `hair()` strokes; knit stripes are short bold `dashes()`. Strokes use the same per-segment id map as the pastel vignette. The tooth showing through the wax and a little waxy relief at the edges of the deposit are added in `render()` |Ask Claude to *"draw it yourself"*, *"paint this with code"*, or *"claude绘图"*, and name a style if you like. Claude then:@@ -438,6 +439,14 @@ Every style has a complete example: `python3 examples/<name>.py out.png --stages- a hair curtain darkened all round its edge is a headphone, and a plain black fringe is a visor — light the whole bob as one mass, darken only the edge against the cheek and give the fringe its own band of sheen;- cupped mittens read as a crab, and mittens that hide the jar hide the point — hold the jar low from the sides, with the thumbs in front;- flat-shaded leaves all seen face-on are clip art — broaden the lobes, foreshorten each leaf and let it cast a soft shadow.+- **Oil-pastel portrait**: keep the figure on bare white paper and the palette tight — saffron, navy, black, one cool blue, orange blush, red-orange lips. Lay big masses with long parallel strokes at high pressure and let the white specks come from the tooth and the dry stroke ends, not from light pressure everywhere. Leave the face as paper; put the drama in the black eyes and brows and two blush patches. Watch for accidental reads:+ - a mass speckled all over reads as snow — press hard in the body (0.95 and up) and save the dry, open strokes for the run-out at the bottom;+ - a second colour that still shows the first one's streaks reads as tinted glass — and a `spill` that shifts the whole mask also spills into the holes left for things in front: pass `avoid=` everything in front;+ - a pale tint scumbled over the whole face, lit as wax relief, reads as plaster — leave the face as paper and weaken the relief on pale wax;+ - small black dots for irises stare — lower the upper lid and show a big dark iris only inside the opening;+ - hair swept sideways with a hard edge across the forehead is a beret — hug the forehead with the far side of the hair, aim the strokes up and back past the bun, and clip the strands to a slightly grown hair mask;+ - white fingers on a white cup are a barcode — give each finger a pale peach body, a peach underside and a rounded tip, and lay them over a darker band (the cup's sleeve);+ - a run-out that stops on a ruled line looks cut — spill each stretch of the edge by its own distance.### Roadmap@@ -449,7 +458,7 @@ Every style has a complete example: `python3 examples/<name>.py out.png --stages### 这是什么-一个 [Claude Code](https://claude.com/claude-code) skill,加上一个小巧的绘图库,内置七十七种画风:+一个 [Claude Code](https://claude.com/claude-code) skill,加上一个小巧的绘图库,内置七十八种画风:| 画风 | 模块 | 为什么看起来像真的 ||---|---|---|@@ -530,6 +539,7 @@ Every style has a complete example: `python3 examples/<name>.py out.png --stages| **彩色小镇** | `lib/colortown.py` · `ColorTown` | 不透明水粉平涂加细细的深棕墨线画的童话山城:番茄红、芥末黄、青绿、薄荷、珊瑚、奶白的窄高房子一排压一排堆上山坡,深蓝灰的石板曼莎屋顶,一座白色钟楼,好几层三角彩旗斜穿街道,爬藤玫瑰、窗台花箱,前景的湿广场把这一切倒映下来。每一块颜色都是一个多边形:几万块一次画完,Pillow 把每块按序号填进 2 倍超采样的整数 id 图,numpy 对每个 id 查一张颜色、不透明度、纹理权重表,再 box 平均回像素,所以边是抗锯齿的,画的先后就是序号的先后。整张画布预先算好三张纹理场(竖向笔刷条纹、横向笔刷条纹、各向同性的擦笔)加一层低频斑驳,每块颜色只差百分之几:墙以擦笔为主、带一点竖向笔刷,天空和铺地偏横向,浅色的纹理少一些,白墙才干净。边缘重采样后沿法线推一点平滑的抖动,没有尺子画的直线,颜色和描线也不完全对齐。墨线是深暖棕,每组颜色画完再画这一组的线:每条线在 3 倍 id 图里有自己的序号(交叉处不叠出墨珠),分成几段、粗细略有变化,方框四边分开画、转角偶尔出头;墨半透明,在红墙上是深红棕,在玻璃上近乎黑。`house()` 用几个数搭出一栋联排房子。墙是带裸石斑块的灰泥,有腰线、檐口,墙脚一层薄罩染,檐下一道淡阴影。底层是门、带字招牌和条纹遮阳篷的店面,或者拱门。楼上的窗格子每扇都略有不同:奶油色窗框,深青绿玻璃上一道浅色反光,窗棂、窗台,部分窗户有带横条的百叶窗,部分挂窗帘。窗台花箱的花叶溢出来,铁艺阳台后面摆着花盆。屋顶的石板一片片错缝铺上去,每片蓝灰各不相同,裁进屋顶、描出缝;有曼莎、四坡、侧山墙、尖山墙,带老虎窗、带赤陶帽的烟囱和电视天线。`plane()` 用透视单应把一块平摊的立面贴到四边形上,整面峡谷墙连窗、花箱、玫瑰一起往消失点收。远近靠雾化、尺度和从后往前的遮挡,几乎没有投影。玫瑰是成对小叶里的不规则杯形,花心深一点、描几道花瓣弧线;树冠是一团团叶片,每团按左上来光当穹顶打光;彩旗绳按抛物线下垂,三角旗挂在绳上,每面有一道深一点的折痕。湿街按每一列的墙脚线把画面镜像下来,加涟漪,离墙脚越远竖向拖得越长,压暗后拖成竖条混进浅色石板,再淡淡地重描石板缝;`mirror()` 把之后画的东西(人、路灯)也倒映下来。附带洋葱顶、木百叶钟楼开口的钟楼,越往上越小的台阶、石墙、铁栏杆、路灯、吊挂店招、海报、咖啡桌、猫和不画脸的小人 || **色粉小像** | `lib/pastelvignette.py` · `PastelVignette` | 白纸上的绘本角色小像,软色粉加一点水粉:一个人和他的小动物,半身,不画背景色块、不加边框,画到边上就停,颜色干笔散进白纸。颜色柔和、粉粉的(粉蓝、奶油、暖肤色),只有一组暖橙饱和;脸揉得平滑,大圆眼、一大圈腮红、红鼻尖;头发和毛是成百上千根细丝。纸纹直方图均衡过,另外预先算好沿 8 个方向拖开的纸纹(存成 uint8):色粉挂在纸纹高于 1 − 压力的地方,漏掉的纸坑顺着笔拉成短道。每一笔的每一段在 2 倍超采样的整数 id 图里有自己的序号,numpy 对被盖住的子像素查回这一段,算出沿笔位置(两头收圆的压力曲线)和横向位置(两侧软边、越干越开的鬃毛条纹),压力够得着纸纹才上色,bincount 汇回像素,几万笔只要每段一次 Pillow 画线。色粉近乎不透明,浅色干笔能压在深色上。`wash()` 是手指揉开的色粉:平滑的一层,颜色可以按受光场取,最深的纸坑留一点浅,边缘按纸纹断开;`model()` 按软穹顶光把暗 → 亮的色阶揉上去。大衣用一张平滑的渐隐场收掉,干笔在它下面再走一段、逐像素变干。`strands()` 沿流向场画发丝,按绺分组(同一绺共用起点、偏移、弯曲和明暗),暗先亮后,几根飞出轮廓;`fur()` 是背光一侧暗的毛簇;`fluff()` 从轮廓里侧往外长短丝,颜色取它里面的颜料,毛茸茸的边融进后面的东西。五官:`eye()`(米白眼球、眼皮下灰蓝的影子、带放射纹的虹膜、瞳孔、两点白高光、外眼角挑出的软眼线)、`blush()`、`nose()`(鼻梁软影加红鼻尖)、`mouth()`、`brow()`。附带背景草稿用的淡铅笔线、叶子和枝条 || **诗意万圣夜** | `lib/poetichalloween.py` · `PoeticHalloween` | 秋夜 / 万圣节的忧郁、带一点超现实的绘本肖像,暗色画板上的不透明水粉加细彩铅排线,再印出来:瓷白的脸,鼻子、脸颊、眼皮和眼睛四周泛着很重的红晕,半闭的厚眼皮,不笑的小嘴,体积极简;头发是一整块雕塑般的实体——刀切齐刘海的乌黑波波头,一道柔和的光泽;衣物是摸得着的织物(粗麻 / 毛毡帽子、粗针织、格子呢);底子是靛蓝夜空、星星和浓密的叶丛;只有一处发光的点睛:眼睛和衣摆尖发着暖光的床单小幽灵。笔触和色粉小像同一套按段编号的 id 图(宽的是水粉干笔,细长的是排线),`colour='canvas'` 让每一笔取它中心下面的颜色,把算出来的底子(格子呢、塑形过的脸、夜空)用手再画一遍、颜色不变。`model()` 按软穹顶光揉色阶,就是那种极简的体积;`sheen()` 只在受光落在一条窄带里的地方铺一层柔和的光泽,再顺着头发拉几笔又长又淡的笔触,波波头仍是一整块。`eye()` 是重眼皮的杏仁眼:上眼皮盖住约一半虹膜、往外眼角垂,深色眼线,下眼睑一道湿红,还可以映出下面那盏光的一点暖色;`flush()` 是平滑的一层红加一层单像素的细斑点,越红越密;`nose()` 自成一个小体积,红鼻尖。`burlap()` 是粗麻平纹:每行每列线各自粗细、有疙瘩、略游走、一上一下交织,当高度场打光,线间是黑孔,有松出的纤维和毛边,能顺着弧线织;`knit()`、`rib()`、`tartan()`(镜像 sett、2/2 斜纹、乘衣褶的受光)管其余的织物。`leaf()` 是宽裂片、重锯齿的掌状叶,随机压扁、沿中脉对折,往后面的叶子投一块软影子,树丛的层次就从这里来。暖色点光源衰减很陡,`illuminate()` 按 1 −(1 − C)·exp(−L·接受度·(base + albedo·C)) 照亮画好的东西:毛线和瓷白的脸变暖很多,小幽灵旁边的叶子变成橄榄橙,黑头发几乎不变。`ghost()` 是银色细丝组成的半透明圆顶钟形,像头发一样从头顶披下,发光的眼睛,每一绺末端一颗光珠。光晕、细的印刷颗粒和暗部更显的粗印刷纸纹在 `render()` 里加 |+| **油画棒肖像** | `lib/oilpastel.py` · `OilPastel` | 白色糙面纸上的油画棒(蜡笔)人物小像,人浮在白纸上——不画背景,至多一抹天色或一块干刷的投影。颜色收得紧而浓:藏红花黄和金盏黄、偏青的藏青和黑、一种冷蓝,加橙色腮红和橙红嘴唇。大衣、围巾、帽子这类大块颜色用宽度不变的棒一道道平行地铺满;蜡挂在直方图均衡过的纸纹凸起上、跳过纸坑,所以每块颜色里都撒着脆的白点,顺着笔拉成短道(纸纹预先沿 8 个方向拖开)。棒用秃了的那一面分成几道,每道自己的压力、明暗和终点,所以起笔钝而饱满、收笔是一把长短不一的硬梳齿;`spill` 让笔触冲出形状,每段边冲出去的距离各不相同。黑色蜡笔(`crayon()`:抖动、分段搭接、粗细不一的线)只用在眼睛、眉毛、鼻孔和几处轮廓、衣褶上。脸就是纸,背光一侧几笔桃色,排线的橙色 `blush()`,平涂的 `lips()`,压低眼皮的黑色 `eye()`;头发是几笔收尖的长 `hair()`;针织条纹是短而粗的 `dashes()`。笔触和色粉小像同一套按段编号的 id 图。蜡下面透出来的纸纹和蜡边缘的一点厚度在 `render()` 里加 |对 Claude 说「claude绘图」「你自己画」「用代码画」,也可以指定画风。它会:1. **先定构图**:层次、焦点、留白,而且画面要图解内容本身;@@ -636,6 +646,7 @@ python3 examples/pencilbook_tortoise_crossing.py out.jpg --stages stages/ #python3 examples/colortown_festival_steps.py out.jpg --stages stages/ # 彩色小镇:雨后的节日台阶街python3 examples/pastelvignette_marmalade_scarf.py out.jpg --stages stages/ # 色粉小像:橘猫围巾python3 examples/poetichalloween_ghost_jar.py out.jpg --stages stages/ # 诗意万圣夜:罐子里的小幽灵+python3 examples/oilpastel_warm_cup.py out.jpg --stages stages/ # 油画棒肖像:捧着一杯热的```### 作画要点(Claude 交图前逐条自查)@@ -786,6 +797,14 @@ python3 examples/poetichalloween_ghost_jar.py out.jpg --stages stages/ # 诗- 一圈都描了暗边的那片头发像耳机,纯黑的刘海像护目镜——整块头发按同一个受光,暗边只留在挨着脸的内侧,刘海单独一条光泽;- 捧在一起的手套像螃蟹,挡住罐子的手套挡住了重点——从两边扶着罐子下半截,拇指搭在前面;- 正对着看、平涂的叶子是剪贴画——裂片加宽,每片压扁一点,再往后面投一块软影子。+- **油画棒肖像**:人放在光着的白纸上,颜色收紧——藏红花黄、藏青、黑、一种冷蓝,橙色腮红、橙红嘴唇。大块颜色用长的平行笔、压力要大,白点交给纸纹和干的笔尾,不要处处都轻。脸留成纸,戏放在黑眼睛、眉毛和两块腮红上。小心看错:+ - 满块都是白点就成了下雪——块身的压力 0.95 以上,又干又散的笔留给下摆收尾;+ - 第二种颜色还透着第一种的道子就像有色玻璃——而且把整张遮罩平移的 `spill` 也会冲进前面东西留出来的空里:传 `avoid=` 前面所有东西;+ - 整张脸铺一层淡肤色、再加上蜡的厚度,就像石膏——脸留成纸,浅色的蜡厚度减弱;+ - 小黑点当虹膜会瞪人——把上眼皮压低,大而黑的虹膜只画在开口里;+ - 头发横着扫、前额一道硬边就是贝雷帽——远侧的头发贴着额头,笔触朝发髻上方往上再往后,发丝裁到稍微放大的头发遮罩里;+ - 白杯子上的白手指像条形码——每根手指铺一层浅桃色,下沿一道桃色,圆指尖,搭在颜色深一点的杯套上;+ - 下摆停在一条直线上像被剪过——每段边冲出去的距离各不相同。### 计划diff --git a/SKILL.md b/SKILL.mdindex c8e63b4..3d7a890 100644--- a/SKILL.md+++ b/SKILL.md@@ -1,6 +1,6 @@---name: claude绘图-description: Claude 绘图 / Claude Drawing —— 不借助任何生图模型,由 Claude 用代码一笔一笔「画」出图片(程序化绘画)。内置七十七种画风:中国水墨、水彩、剪纸拼贴、韩国彩铅、日本动漫、编辑风手绘(Riso)、油画厚涂(梵高式流向笔触+颜料浮雕打光)、浮世绘木版画(晕色、木纹、墨线主版、青海波)、像素风(低分辨率+Bayer 抖动+像素字体)、黏土定格(高度图捏出的彩泥+影棚打光)、蓝晒(普鲁士蓝日光晒图,植物剪影透光)、十字绣(Aida 布十字绣+回针绣+缎面绣+法式结)、复古仪器面板(60 年代收音机/仪器正面:柚木、拉丝铝、旋钮、刻度窗、指示灯)、贴纸拼贴·小票(模切乙烯贴纸、热敏小票、和纸胶带、吊牌、橡皮章)、实验笔记本·贴纸(线圈方格本、铅笔图表、荧光笔、红笔圈、便利贴)、黑板板书(墨绿石板、粉笔颗粒、板擦残影、示意图与公式)、赛博朋克(雨夜霓虹街道、玻璃管霓虹招牌、全息广告、湿路面倒影)、卡通手绘(蓝铅笔稿、毛笔线、错位平涂、赛璐璐阴影、逐帧抖线)、等轴 2.5D(正等轴微缩模型、一个太阳照出三面明暗、悬浮数据卡)、单线画(一根不断开的线一笔画完、唯一点睛色)、柔光 3D(光线追踪的糖果色小球海和鼓鼓的软字、景深)、形变动画(一条轮廓依次变形、洋葱皮残影、缓动曲线)、报刊拼贴(牛皮纸、手撕旧报纸、网点老照片、勒索信拼贴字)、弥散玻璃(弥散渐变、磨砂玻璃卡片界面)、包豪斯几何(三原色几何、丝网印刷海报)、复古 Synthwave(切口落日、霓虹网格、镀铬字、录像带质感)、拼豆(钉板上的熔珠小管、熨烫熔合)、岩画(沙漠漆上凿出的凹坑图形、新旧凿痕、剥落)、古埃及墓室壁画(灰泥墙、红格起稿、分栏叙事、象形文字、剥落)、罗马马赛克(石子与玻璃沿轮廓一排排铺、灰缝、燕尾铭牌)、彩色玻璃花窗(哥特尖拱窗、通体着色玻璃、grisaille 彩绘与银染、铅条、透光)、泥金手抄本(羊皮纸、鹅毛笔哥特体、朱红标题、打磨金箔首字母)、达·芬奇手稿(铁胆墨水、左手排线、红粉笔、镜像手写、机械分解图)、剪影(黑纸剪出的侧影小像、薄金粉、椭圆金框)、凸版印刷海报(木活字、红黑双色错版、木刻插图)、苏联构成主义(红黑两版、斜条与楔形、西里尔大字、网点照片拼贴)、装饰艺术 Art Deco(1930 年代喷枪流线型海报、交替射线、阶梯高楼、金色 Deco 字)、黄金时代漫画(毛笔墨线、Ben-Day 网点、四色错版、新闻纸)、波普丝网(多格撞色平涂 + 错位的照相黑版)、ASCII 字符画(行式打印机、绿条连续纸、叠打)、低多边形(1999 年代 3D:平面着色、仿射贴图、逐顶点雾、15 位色抖动)、喷漆模板涂鸦(混凝土墙上多层卡纸模板喷绘、雾化与滴痕)、刺绣徽章(牛仔布上的机绣徽章:填充绣、缎面绣、锁边)、蓝图工程图(描图墨线晒成蓝底白线)、儿童蜡笔画(小孩在糙纸上的蜡笔涂抹)、绿屏终端 CRT(荧光字符画、扫描线、余辉)、热成像(先画温度场再上伪彩色)、代尔夫特蓝瓷砖(锡釉砖上的钴蓝手绘)、洞穴壁画(火光下的赭石、吹喷手印)、1-bit 早期画图软件(黑白整屏、8×8 图案填充)、古希腊黑绘陶瓶(黑釉剪影、刻线、饰带展开图)、铅笔素描(石墨排线、擦笔、边缘只剩线稿)、X 光片(安检透视、轮廓发亮、伪彩)、1930 年代黑白橡皮管动画(白手套、饼切眼、老胶片)、黑白麻胶版画(刻刀减法、手拓发花、套色错版)、VHS 家庭录像(钨丝灯偏色、色度渗色、REC)、扁平矢量(分层几何色块、七色、层间投影)、绘本角色动画(小角色挤压拉伸的真动画)、圆珠笔涂鸦(蓝红圆珠笔线稿、墨团、彩铅、页边涂鸦)、描图纸叠层(灯箱上的黑线底图 + 一张张单色描图纸叠片:正片叠底、套准十字、定位钉、绘图胶带)、粉彩界面 · Pastel UI(产品发布片式的界面画面:纯色粉彩底与大光斑、macOS 窗口卡片、胶囊与粗黑标题色条、状态标签与 ✓ / ✗ 徽章、放大镜、从卡片边探头的扁平小图标)、阅卷批改 · Exam Grading(绿毛毡桌上被红笔批改的答题卡:定位黑块、考号涂卡、得分格与阅卷栏、长尾夹夹住的标准答案卡、油墨不均的朱红印章、立体红笔、波浪线 / 圈 / 引线 / 批注 / 叉 / 圈起来的分数)、皮影戏 · Shadow Puppetry(油灯照亮的幕布上,雕空、透明染色的驴皮关节人偶:镂空纹样、阳刻空脸、雉翎盔头、线结与操纵杆、离幕时虚化的双影;雕花戏台、红漆金字牌匾、红灯笼)、钢笔淡彩 · Pen & Wash(速写小卡上的针管笔线稿 + 松散淡彩:线条抖、出头、不闭合,颜色错位出线、留白缝、干边与颗粒,不铺满的背景色块;大头、圆眼镜、点点眼、红鼻子的呆萌小人;卡片拍在木桌上,旁边放着针管笔和水笔)、复古水粉 · Retro Gouache(复古绘本风的水粉大头像:不透明水粉从暗到亮一层层盖上去,单色背景用干笔皴擦;大红鼻子、腮红、圆眼和大耳朵用几阶色值塑出来;看得见针脚的毛衣和毛线帽,一根根的头发和胡子,毛毡;最后是印刷书页的纸纹)、蓝调绘本 · Blue Picture Book(软蓝色调的现代绘本跨页:几乎只用粉蓝、矢车菊蓝、深青蓝三阶蓝加黑墨和纸白,只点一点珊瑚红、粉色腮红和芥末黄;毛笔 / 墨铅笔线干、抖、断,粗细不匀,线不闭合,暗部用快速来回的乱线排出来;颜色是干蜡笔、粉彩、干水粉,错位出线,纸纹的白点透出来;白粉笔痕压在蓝上,甩点和细尘;背景蓝块毛边、不到纸边;大圆脑袋、带高光的点点眼、点彩腮红和雀斑、火柴腿穿靴子的小人,乱线毛边的白色毛绒动物;最后印在书上:中缝和页码)、江南园林 · Jiangnan Garden(细笔园林春景,数字水粉插画:成千上万片叶形小笔触按一个太阳堆出树冠,暗芯、亮边、一簇簇的高光;白色和淡粉的繁花是一簇簇圆点花瓣,枝条从缝里露出来;垂柳是一绺一绺发丝般的细枝挂满小叶;黛瓦飞檐是真的瓦垄:筒瓦板瓦一行行、檐口瓦当滴水、翘起的翼角和卷起的脊头;粉墙月洞门、冰裂纹漏窗、翡翠绿槅扇和挂落、红灯笼、匾额;九曲石桥、石阶、小木船;碧绿湖面倒映岸上的一切,更柔、更暗,加涟漪和细竖纹;睡莲、白鹭;从前景花枝到雾里青山层层退远,墙上桥上落着叶影;最后一方小红印)、干刷色块 · Dry-Brush Blocks(mid-century 海报 / 水粉拼贴式的编辑插画:米白纸上几大块干笔或滚筒刷出的色块,颜色严格限定在森林绿、鼠尾草绿、青蓝、藏蓝、近黑和朱红,外加一点天蓝、淡青瓷和米色;每块颜色在自己的笔刷坐标系里刷:一道道平行的笔,起笔饱满、收笔干枯,两侧几乎是直边,两端梳成长短不一的毛齿,块里有顺笔的鬃毛纹、皴擦斑和露出来的纸色;背后的大色板用滚筒:近乎平涂、成簇的细点、干的两侧和几道细刮痕;色块像丝网套印或撕纸拼贴一样叠起来,撕口带一圈浅色纤维边;人物拆成几个大块面:亮暗两半朝不同方向刷的外套、几块肤色平面拼的头、粗黑框眼镜、干笔皴擦的白胡子;瓶子是竖刷的深色剪影加一道高光和小块标签;一旁一个小朱红方块;不勾线、不做渐变;最后像胶印:轻微柔化、纸纹、暗部零星白点、纸上细尘)、暮色微缩绘本 · Twilight Storybook(温柔、怀旧的黄昏绘本单页,满是微缩细节:大片粉彩黄昏天空,从顶上的薰衣草紫经玫瑰、蜜桃到地平线的暖金,柔和的平底云带、细细的光线和一轮低垂的淡日;一侧天空已经入夜:星空、带暗带的银河、弯月、流星,昼夜交界经过淡紫和靛蓝,不发灰;下面是一层层粉彩条纹的起伏山丘,拼布似的田、细细的垄、小圆树;前景是几万朵小野花铺成的坡,坡顶是色点,越往下越大:雏菊、矢车菊、虞美人、波斯菊、金盏花、毛茛、羽扇豆、勿忘我,夜的一侧整片变成月光蓝;很小、扁平、可爱的原创角色;上面叠一层科学图版的语言:圆形的「detail a」放大图,细墨线、排线、尺寸标注、标签和比例尺,几行灰色的小写英文手写字;最后是细颗粒、光晕、暗角和底边一道撕纸边)、排线夜景 · Hatched Nocturne(彩铅 / 色粉排线式的小幅夜景版画:天空、云、山和海全由密密的短笔触叠成,每片区域的笔触顺着同一股「风」走——天空斜着流、蒸汽绕着云团卷、山坡顺着坡向、海面横着长拖,每一笔色相和明度都差一点,笔毛分道、拖干的笔尾、纸纹里漏出的细缝,没有一处平滑渐变;深靛蓝、藏青、冷灰蓝的夜色里只有一个暖色光源,光是一层层加上去的发光笔触:核心黄白、外圈橙红、再外是被照亮的笔触,被照亮的蒸汽按「光 × 受光」上色,所以是红橙而不是粉;发光的细丝(会蜿蜒、分股、末端亮珠)、火星、星点;海面上被横向笔触打碎的倒影和光柱;几十像素高的小人靠一点亮色(围巾)点出来;最后装裱成小版画:米白纸边、压印的版痕、左下铅笔小标题、右下更小的说明,用细的普通字体)、笔记应用界面 · Obsidian UI(讲解片里的深色笔记应用窗口:近黑页面上一团淡紫光晕,窗口里有标签栏、细长图标栏、带缩进线的文件列表、粗黑 H1 下一道紫色短条、属性块和 #标签、紫色的内部链接和行内代码、带语法色的 mermaid 代码块——点「阅读」后渲染成扁平深色的流程图,一个节点亮紫——紫色左边的引用标注,右栏关系图谱里被链接的笔记亮成紫色光点;全画只有一个紫色强调色,不画官方 logo)、白板卡片 · Canvas Board(深色笔记应用的白板视图:深色页面上一扇应用窗口——红黄绿三点和「.canvas」标签页的标签栏、左边一列线性图标——里面是一块随镜头平移缩放的灰点阵无限白板;分组框和浮在框上方的组名,深色圆角卡片带 2 px 的卡片色边(红、橙、黄、绿、青、紫)和一层很淡的同色底,卡片之间是从边的中点沿法线弯出去的曲线连线,末端实心箭头、中间一块白板底色的标签;卡片里是 Markdown:标题、正文、紫色高亮、等宽行内代码、勾选清单(勾上时紫色方框弹出、对勾画出、文字变灰加删除线)、紫色竖条的引用、紫色标签胶囊、颜色编号胶囊;图片卡片上方写文件名,里面可以用手绘笔触画草图(每笔画两遍、略弯、出头,手写体批注);右上角一列缩放按钮;全画只有一个紫色强调色加卡片色;所有东西都记在白板坐标里、每次按镜头重画,任意缩放都锐利,镜头能平移缩放、卡片能掉落、连线能一点点画出来)、Flexoki 纸面 · Flexoki Paper(文档站式的图解页:暖白纸 #FFFCF0 上的墨黑字和一串暖灰,几张不描边、不投影的浅灰圆角卡片,粗黑中文标题、灰色英文类型名、等宽编号;卡片里的图照轻量图表渲染器的样子画——比底色差一级的框和 2 px 灰边(直角、圆角、胶囊、菱形、圆柱、圆)、墨线末端一个小的实心三角箭头、普通半粗体标签垫一块底色,虚线生命线和回复、带纸色缝的饼图、细网格上的柱状图、表头着色的对比表;Flexoki 的橙、红、蓝、绿、紫、青只放在有意义的地方,橙色聚焦框、黑底胶囊、字距收紧的大数字;能做成图一边一边画出来、数字滚动的动图)、暖调彩铅绘本 · Warm Pencil Storybook(暖白、有齿纹的纸上一层层叠涂的彩色铅笔绘本页:天空、山坡、草、水、一只大而温柔的生物和一个小小的孩子,全由顺着形体走向的细铅笔线叠成——天空横向长排线,山坡顺着坡势,龟壳绕着每块盾片的生长纹,脖子横过褶皱,雨衣顺着衣褶,苔藓和头发一簇簇顺毛;每块先铺一层浅色底,再上固有色、背光处叠同色系的深色,受光处罩一层暖色、阴影里罩一层冷色,每层角度错开一点、笔触交叉;蜡只挂在纸齿的峰上,同一批纸坑一层层都透出细白点,压得重、叠得多的地方才慢慢合上;后画的东西先留白再铺背景,颜色不互相混;毛是一绺一绺的:根部散开、尖端聚拢、顺着毛向,每绺受光一侧亮、背光一侧暗;没有墨线、没有黑色,只有很淡的同色轮廓;黄昏的暖光:灯笼和窗灯是一层层橙黄的发光叠涂(不是一团光晕,也不是放射线),低低的太阳给受光一侧一道暖边;水里的倒影也是一笔笔横排线;附带树、小房子、石头、鳞片、野花、纸灯笼和穿雨衣提灯笼的小孩等绘本部件)、彩色小镇 · Colour Town(不透明水粉平涂加细细的深棕墨线画的童话山城街景:高高窄窄的房子漆成番茄红、芥末黄、青绿、薄荷、珊瑚、奶白,一排压一排堆上山坡,近大远小、前后遮挡;深蓝灰的石板曼莎屋顶是一片片瓦错缝铺出来的,带老虎窗、烟囱和赤陶烟囱帽、电视天线;白色钟楼、淡蓝的天和奶白的云;三角彩旗串在好几层深度上斜穿街道,远处的小、近处的大,每面旗有一道深一点的折痕;红色爬藤玫瑰、溢出来的窗台花箱、铁艺阳台、石头台阶和扶手、路灯、吊挂的店招、拱门和彩色木门、写着字的店面和条纹遮阳篷;前景是湿亮的街面,把整条街倒映成一道道竖向的笔触;每块颜色都是带一点笔刷纹理的不透明平涂,边缘像手画的那样微微抖,和描线不完全对齐;墨线分成几段、粗细略有变化,方框的转角偶尔出头;墨是半透明的,压在红墙上是深红棕,压在玻璃上近乎黑;窗户排得整齐,但每扇都略有不同;一整面墙可以用透视单应贴成往消失点收的峡谷墙;几乎没有投影;附带钟楼、台阶、矮墙、栏杆、树、花盆、彩旗、路灯、店招、海报、咖啡桌、猫和概括的小人等部件)、色粉小像 · Pastel Vignette(白纸上的绘本角色小像,软色粉加一点水粉:一个人和他的小动物,半身、略偏一边,四周大片留白,不画背景色块、不加边框,画面在边上用干笔散开、融进白纸;颜色柔和、粉粉的——浅粉蓝的衣服上看得见顺着衣褶的干笔、奶油色的毛衣、暖肤色——只有一组暖橙饱和(橘猫、绒球、蝴蝶结这类);脸是揉开的平滑色粉:大圆眼、深色虹膜和两点白高光、一大圈腮红、红鼻尖、小嘴;头发和毛是成百上千根细丝,一绺一绺,有几根飞出轮廓,毛的轮廓蓬松地融进后面的东西;几乎不描线,只有眼皮、鼻翼、脸的背光侧几道细的软线;背后至多一枝叶子和一层很淡的铅笔小镇;附带圆眼、眉毛、腮红、鼻子、嘴、发丝、毛簇、蓬松轮廓、叶子和枝条等部件)、诗意万圣夜 · Poetic Halloween(忧郁、带一点超现实的秋夜 / 万圣节绘本肖像,暗色画板上的不透明水粉加细彩铅排线,再印出来:瓷白的脸,鼻子、脸颊、眼皮和眼睛四周泛着很重的红晕(平滑的一层红加单像素的细红斑点),下眼睑一道湿红,厚眼皮半闭、往外眼角垂,小嘴不笑,体积极简;头发是一整块雕塑般的实体——刀切一样平的齐刘海、乌黑(或银白)的波波头,几乎看不见发丝,只有一道柔和的光泽;衣物是摸得着的织物:粗麻 / 毛毡帽子(一上一下交织的粗线、线间的黑孔、毛边)、粗针织围巾和手套、斜纹织出来的格子呢外套;底子暗而沉——靛蓝夜空和星星、浓密的深色叶丛;每幅只有一处发光的点睛:眼睛和衣摆尖发着暖光的床单小幽灵,暖光照亮身边的叶子、毛线和脸的下侧;满画面一层细的印刷颗粒;附带重眼皮眼、红晕、长鼻子、小嘴、光泽带、粗麻、针织、罗纹、格子呢、毛边、掌状叶和叶丛、暖光照明和光晕、小幽灵、星星等部件)。用户说「claude绘图」「用代码画」「你自己画」「不用生图模型画」「程序化绘画」,或点名以上任一画风(含黏土、彩泥、定格动画、蓝晒、晒图、十字绣、刺绣、复古面板、老式收音机、贴纸、小票、收据、手帐拼贴、实验笔记本、方格本、荧光笔、便利贴、黑板、板书、粉笔、赛博朋克、霓虹、雨夜街道、卡通、手绘卡通、逐帧手绘、抖线、等轴、2.5D、微缩模型、单线画、一笔画、线条动画、柔光 3D、3D 渲染、C4D 风、软糖字、小球海、形变、变形动画、报刊拼贴、剪报、达达、勒索信字、网点印刷、弥散渐变、玻璃拟态、毛玻璃、包豪斯、几何构成、丝网印刷、Synthwave、蒸汽波、合成器浪潮、80 年代复古、拼豆、拼拼豆、熔珠、熨豆、豆豆画、钉板、烫豆、岩画、岩刻、凿刻、石刻、沙漠漆、史前壁刻、大角羊、古埃及、埃及壁画、墓室壁画、法老时代、象形文字、尼罗河、底比斯、罗马马赛克、马赛克镶嵌、镶嵌画、石子拼画、地砖画、古罗马地板、彩色玻璃、彩绘玻璃、花窗、玻璃花窗、教堂花窗、哥特花窗、铅条玻璃、泥金手抄本、手抄本、彩饰手抄本、中世纪手稿、羊皮纸、哥特体、花体首字母、泥金、贴金、星盘、达芬奇、达·芬奇、达芬奇手稿、手稿风、文艺复兴手稿、发明手稿、镜像字、镜像书写、扑翼机、红粉笔、钢笔排线、机械草图、分解图、剪影、剪影肖像、侧影、侧面像、黑纸剪影、剪影小像、椭圆金框、乔治时代肖像、摄政时期肖像、凸版印刷、活版印刷、木活字、铅字海报、马戏团海报、复古海报、老海报、19 世纪海报、双色套印、错版、套色错位、木刻插图、构成主义、苏联海报、苏联构成主义、俄国先锋派、罗德琴科风、红黑海报、照片蒙太奇、照片拼贴海报、西里尔字、装饰艺术、装饰风、流线型、流线型海报、1930 年代海报、旅行海报、铁路海报、火车海报、喷枪画、喷笔画、阶梯高楼、射线背景、盖茨比风、黄金时代漫画、老漫画、复古漫画、美漫封面、漫画封面、Ben-Day 网点、本戴点、网点上色、四色印刷、四色错版、新闻纸、对白框、拟声字、1940 年代漫画、波普、波普艺术、波普丝网、沃霍尔风、丝网版画头像、撞色头像、多格重复头像、六宫格撞色头像、ASCII、字符画、字符艺术、文字画、行式打印机、绿条纸、连续打印纸、针孔打印纸、老电脑打印、叠打、低多边形、低面数、低模、多边形风、千禧年 3D、90 年代 3D、复古 3D 游戏、老游戏截图、PS1 风、N64 风、平面着色、线框、游戏 HUD、飞行游戏、穿环、喷漆、模板涂鸦、镂空模板、喷漆模板、模板喷绘、街头涂鸦、街头艺术、墙绘、滴漆、班克西风格、刺绣徽章、徽章、布章、臂章、刺绣贴、绣标、锁边、牛仔外套徽章、户外徽章、营地徽章、弧形条章、蓝图、工程图、施工图、蜡笔画、儿童画、绿屏终端、CRT、显像管、热成像、热像仪、温度图、代尔夫特、荷兰蓝瓷砖、洞穴壁画、史前壁画、赭石、1-bit、黑白画图软件、MacPaint 风、黑绘、古希腊陶瓶、希腊瓶画、铅笔素描、素描、铅笔画、X 光、X 光片、安检图像、橡皮管动画、黑白卡通、老动画、麻胶版画、黑白版画、藏书票、VHS、家庭录像、录像带、扁平插画、扁平风、矢量插画、绘本动画、角色动画、挤压拉伸、圆珠笔、圆珠笔涂鸦、原子笔、页边涂鸦、课本涂鸦、手画棋盘、描图纸、硫酸纸、叠片、叠层、分色片、灯箱、拷贝台、透光台、套准、定位钉、粉彩界面、粉彩 UI、Dot 风、Dot 那种风格、产品发布会界面、发布会质感、窗口卡片、macOS 窗口、界面卡片、讲解片界面页、小图标探头、阅卷、阅卷批改、批改、判卷、改卷、改作业、答题卡、试卷、考卷、测验卷、红笔批改、红笔打分、打分数、盖章批改、朱红印章、标准答案卡、长尾夹、讲解片评测 / 打分页、皮影、皮影戏、影子戏、驴皮影、灯影戏、皮影人偶、雕花戏台、戏台牌匾、亮相、钢笔淡彩、淡彩、淡彩速写、钢笔淡彩小人、针管笔、勾线笔、针管笔加水彩、线稿上色、速写卡片、速写本小人、水彩小卡、城市速写、街头速写、水笔、自来水笔、复古水粉、水粉、水粉画、不透明水粉、哑光丙烯、复古绘本、绘本插画、绘本大头像、童书插画、复古童书、大头像、大鼻子人物、针织毛衣、麻花毛衣、毛线帽、毛毡帽、卷发、胡子、蓝调绘本、蓝色绘本、软蓝绘本、蓝调童书、软蓝童书插画、蓝色童书插画、蓝色系绘本、限色绘本、蓝白绘本、现代绘本跨页、手绘绘本跨页、绘本跨页、绘本内页、干笔墨线、墨铅笔线、粉彩蜡笔质感绘本、白色毛绒动物、毛绒白熊、点彩腮红、江南园林、园林春景、春水园林、中式园林插画、古典园林插画、国风园林插画、苏式园林、细笔园林、园林风景插画、水榭、临水茶榭、亭台楼阁、粉墙黛瓦、黛瓦白墙、飞檐翘角、翼角起翘、月洞门、漏窗、冰裂纹窗、槅扇、挂落、九曲桥、曲桥、垂柳园林、碧水倒影、园林倒影、睡莲池、数字水粉风景、细腻厚涂风景、干刷色块、干笔色块、干刷、干刷插画、干笔插画、滚筒刷、滚筒色块、色块插画、大色块插画、毛边色块、刷痕色块、粗刷笔触、mid-century、世纪中期插画、中世纪现代插画、复古编辑插画、复古海报插画、水粉拼贴、撕纸色块、限色海报、暮色微缩绘本、暮色绘本、黄昏绘本、微缩绘本、黄昏转夜、昼夜交界、日夜交界、半边黄昏半边星空、粉彩黄昏、粉紫晚霞、黄昏星空、银河插画、野花坡、野花草坡、花海插画、萤火虫、放风筝插画、拼布山丘、条纹田野、小圆树、细节放大图、局部放大图、技术细节小窗、科学图版风插画、手写英文小字、晚安绘本、治愈系绘本插画、排线夜景、排线风夜景、彩铅夜景、色粉夜景、粉彩排线、短笔触夜景、笔触夜空、方向笔触、夜景版画、小版画、限量版画风、版画装裱、版痕、纸边标题、铅笔题字、夜景插画、夜空插画、深蓝夜景、靛蓝夜空、冷暖对比夜景、唯一暖光、夜里的火光、发光的云、被照亮的云、红色精灵闪电、精灵闪电、火山夜景、熔岩入海、熔岩、岩浆、火山喷发插画、海上风暴、海面倒影、光柱倒影、火星飞溅、星点、看海的人、礁石上的人、远处的小人、小人比例尺、雪夜篝火、渔火、笔记应用界面、笔记软件界面、笔记 App 界面、Obsidian 风、Obsidian 界面、Obsidian 风格、黑曜石笔记、深色笔记界面、暗色主题界面、Markdown 笔记、Markdown 编辑器、双链笔记、内部链接、关系图谱、知识图谱界面、图谱视图、局部图谱、反向链接、文件列表、侧边栏、标签页、属性栏、行内代码、代码块、mermaid、mermaid 流程图、代码块渲染成图、源码 / 阅读切换、阅读视图、引用标注、callout、读书笔记界面、知识库界面、第二大脑、讲解片里的笔记应用、应用窗口演示、白板卡片、无限白板、白板视图、画布视图、Canvas 视图、Obsidian Canvas、Obsidian 白板、笔记应用白板、卡片白板、卡片和连线、节点和连线、带箭头的连线、弯曲连线、连线标签、分组框、点阵背景、点阵白板、深色白板、深色界面卡片、彩色边卡片、勾选清单卡片、待办卡片、引用卡片、图片卡片、草图卡片、手绘平面图、缩放按钮、镜头平移、镜头缩放、卡片掉落动画、连线画出来、搬家计划、旅行计划白板、活动计划白板、头脑风暴白板、项目拆解白板、计划白板、Flexoki、Flexoki 纸面、Flexoki 配色、Flexoki 风、暖白纸、米白纸面、墨黑字、文档站风格、文档页图解、技术文档配图、图解页、一页图解、讲解片图表页、几张图讲清楚、流程图、画流程图、时序图、序列图、饼图、柱状图、条形图、对比表、参数对比、图表合集、图表墙、Mermaid 风、Mermaid 图、图表渲染器、灰底圆角框、小三角箭头、橙色聚焦框、数字滚动、计时器大数字、配方图解、步骤图解、手冲咖啡图解、菜谱图解、工作流程图解、暖调彩铅绘本、暖调彩铅、彩铅绘本、彩铅童书、彩铅童书插画、彩色铅笔绘本、彩色铅笔童书、软彩铅、彩铅叠涂、层层叠涂的彩铅、顺着形体排线、纸齿白点、纸纹透白、怀旧童书、翻绘本的感觉、温暖怀旧的绘本、暖色绘本页、巨物与小孩、大动物和小孩、巨大温柔的生物、温柔的巨兽、大乌龟、巨龟、老乌龟、背着花园的乌龟、龟背上的小花园、大龟过河、过河、小溪、踏脚石、提灯笼的小孩、黄色雨衣、纸灯笼、亮灯的窗、亮灯的小房子、黄昏小镇、成簇的毛、顺毛、毛一绺一绺、苔藓、金黄的树、彩色小镇、彩色房子、彩色街景、童话小镇、童话街景、治愈小镇、理想的生活环境、欧洲小镇、山城小镇、钟楼小镇、彩虹小镇、彩旗、三角彩旗、彩旗串、彩旗街、节日街道、节日早晨、钟楼、白色钟楼、洋葱顶、石板屋顶、曼莎屋顶、老虎窗、烟囱帽、电视天线、风向标、爬藤玫瑰、窗台花箱、铁艺阳台、台阶街、石头台阶、拱门下的台阶、湿街倒影、雨后街道、雨后的广场、水粉街景、水粉加描线、水粉平涂加细线、细节多到看不完、小红书彩色小镇、色粉小像、色粉画、软色粉、色粉笔触、色粉质感、色粉加水粉、粉彩笔触、粉彩质感、绘本角色、绘本人物、绘本小像、角色小像、人物小像、半身像、人和宠物、人和猫、人和狗、主人和宠物、抱着猫、抱着狗、橘猫、大橘、毛茸茸的猫、毛茸茸的狗、狐狸、猫围巾、把猫当围巾、白底插画、留白插画、不画背景、边缘散开、干笔散开、画到边上就散了、大眼睛、大圆眼、大腮红、红鼻头、红鼻尖、发丝、一根根头发、头发丝、飞丝、毛绒绒、蓬松的毛、温柔的小像、治愈系角色、Midjourney 色粉风、诗意万圣夜、诗意万圣节、万圣节、万圣夜、万圣节插画、万圣节绘本、万圣节头像、秋夜、秋夜插画、忧郁绘本、忧郁风、超现实绘本、诡异又温柔、瓷白的脸、瓷娃娃脸、瓷偶、脸上的红晕、红眼眶、红眼圈、红鼻头、厚眼皮、半闭的眼睛、悲伤的眼睛、不笑的小嘴、波波头、黑色波波头、银白波波头、齐刘海、刀切刘海、粗麻、麻布、麻袋布、粗麻帽子、毛毡帽、粗针织围巾、毛线手套、格子呢、格纹外套、苏格兰格子、小幽灵、床单幽灵、发光的小幽灵、发光的眼睛、罐子里的幽灵、深色叶丛、星空肖像、Midjourney 万圣风),或 "draw it yourself", "paint with code", "procedural painting", "watercolor / collage / colored pencil / anime / editorial / impasto oil / ukiyo-e / pixel art / clay / claymation / cyanotype / sun print / cross-stitch / embroidery / retro instrument panel / vintage radio / sticker collage / receipt / lab notebook / graph paper / chalkboard / blackboard / cyberpunk / neon city / cartoon / hand-drawn animation / isometric / 2.5D / continuous line / one-line drawing / soft 3D / 3D render / puffy letters / ball pit / shape morph / morphing / newspaper collage / Dada / ransom note / halftone / glassmorphism / aurora gradient / Bauhaus / geometric poster / screen print / synthwave / retrowave / outrun / perler beads / hama beads / artkal / fuse beads / melty beads / pegboard beads / petroglyph / rock art / rock carving / desert varnish / Egyptian tomb painting / ancient Egypt / hieroglyphs / Theban tomb / Roman mosaic / floor mosaic / tesserae / opus vermiculatum / Pompeii mosaic / stained glass / leaded glass / church window / Gothic window / grisaille / illuminated manuscript / medieval manuscript / book of hours / gold leaf / illuminated initial / blackletter / vellum / astrolabe / da Vinci notebook / Leonardo codex / Renaissance sketchbook / mirror writing / iron-gall ink / red chalk / sanguine / ornithopter / exploded view / inventor's sketch / silhouette / silhouette portrait / cut-paper profile / shade portrait / Georgian portrait / Regency portrait / oval gilt frame / letterpress / wood type / playbill / circus poster / Victorian poster / two-colour misregistration / woodcut poster / constructivism / constructivist poster / Soviet avant-garde / Russian avant-garde / Rodchenko style / photomontage poster / art deco / streamline moderne / 1930s travel poster / railway poster / airbrush poster / sunburst rays / Gatsby style / golden age comic / vintage comic book / comic cover / Ben-Day dots / four-color printing / newsprint / speech balloon / pulp cover / pop art / Warhol-style / pop silkscreen / silkscreen portrait / repeated pop portrait grid / ASCII art / text art / typewriter art / line printer / greenbar / fanfold paper / tractor feed / overstrike / printer plot / low poly / low-poly / retro 3D / 90s 3D game / PS1 style / N64 style / software rasterizer / flat shading / affine texture mapping / vertex fog / game HUD / stencil / stencil graffiti / spray paint stencil / street art / drips and overspray / Banksy-style stencil / embroidered patch / embroidery patch / iron-on patch / sew-on patch / merit badge / camp badge / merrow border / rocker patch / denim jacket patches / blueprint / technical drawing / crayon / kid's drawing / CRT terminal / green screen / thermal camera / thermal imaging / Delft tiles / Delft blue / cave painting / ochre / Lascaux-style / 1-bit / MacPaint-style / black-figure / Greek vase / pencil drawing / graphite / X-ray / baggage scanner / rubber hose / 1930s cartoon / linocut / lino print / VHS / home video / flat vector / flat illustration / storybook animation / squash and stretch / ballpoint / biro / ballpoint doodle / margin doodles / hand-drawn board game / overlay sheets / tracing-paper overlays / light box / colour separations / registration marks / acetate overlay / pastel UI / Dot-style product film / launch-film interface / macOS window cards / exam grading / grading an answer sheet / red-pen marking / graded test paper / rubber-stamped answer sheet / shadow puppet / shadow puppetry / Chinese shadow play / leather shadow puppets / backlit puppet screen / pen and wash / pen & wash / line and wash / ink and watercolour / ink and watercolor / fineliner sketch / fineliner and watercolour / sketchbook characters / sketch cards / urban sketching / water brush / gouache / retro gouache / gouache portrait / gouache illustration / opaque gouache / matte acrylic / picture-book portrait / vintage picture book / retro children's book illustration / mid-century children's book / big-nosed character portrait / cable-knit sweater / knitted bobble hat / blue picture book / soft blue picture book / soft-blue children's book illustration / modern picture book / limited-palette picture book / picture-book spread / scratchy ink line / dry-brush ink line / ink pencil line / crayon and pastel texture / chalky white marks / blue and coral palette / fluffy white bear / Jiangnan garden / Chinese garden / classical Chinese garden illustration / Chinese water garden / spring garden illustration / lush painterly garden / waterside pavilion / moon gate / lattice windows / zigzag bridge / weeping willow garden / upturned eaves / grey-tiled roof / blossom trees and reflections / lily pond with egrets / digital gouache landscape / dry-brush blocks / dry brush illustration / dry-brushed colour blocks / roller texture / brush-textured shapes / mid-century illustration / mid-century modern poster / mid-century editorial illustration / gouache collage / torn-paper collage poster / limited palette poster / scumbled texture / vintage book cover illustration / twilight storybook / dusk picture book / dusk to night sky / day and night split sky / pastel sunset sky / Milky Way illustration / wildflower meadow / wildflower hill / patchwork hills / tiny round trees / fireflies / paper kite / magnified detail inset / detail callout circle / scientific plate overlay / handwritten lowercase captions / cozy miniature illustration / bedtime story illustration / hatched nocturne / hatched night scene / pastel hatching night / coloured-pencil nocturne / directional strokes / short brush strokes sky / night print with margins / small art print / plate mark / pencilled title and caption / indigo night with one warm light / glowing cloud lit from below / red sprites / lava entering the sea / volcano at night / glowing threads and sparks / broken reflection on the sea / tiny figures for scale / Obsidian UI / Obsidian-style note app / dark note-taking app / dark-theme Markdown editor / note app window / file explorer sidebar / wiki links / backlinks / graph view / local graph / knowledge graph UI / properties and tags / inline code / mermaid code block / mermaid flowchart rendered / source vs reading view / callout block / reading notes app / second brain UI / knowledge base screen / canvas board / infinite whiteboard / dotted board / note-app canvas view / Obsidian-style canvas / cards and connectors / curved arrows between cards / edge labels / group frames / coloured card borders / task-list card / quote card / image card with a sketch / hand-drawn floor plan / zoom controls / camera pan and zoom / cards dropping in / moving plan board / Flexoki / Flexoki paper / Flexoki palette / warm paper and ink / docs-site diagrams / explainer sheet / diagram sheet / Mermaid-style diagrams / lightweight diagram renderer / flowchart / sequence diagram / pie chart / bar chart / comparison table / diagram wall / grey-bordered boxes / small triangular arrowheads / orange focus ring / rolling numbers / recipe explainer / warm pencil storybook / coloured-pencil storybook / colored pencil picture book / soft pencil textures / layered coloured pencil / pencil strokes following the form / paper tooth specks / nostalgic children's storybook / giant gentle creature and a small child / giant tortoise / tortoise with a garden on its back / stepping stones / child with a lantern / yellow raincoat / paper lantern / lit windows at dusk / tufted fur in locks / Midjourney sref 3220081856 look without an image model / colour town / colorful European town / storybook street / fairy-tale town / candy-coloured houses / hill town / bunting / pennant flags / festival street / clock tower / onion dome / slate mansard roofs / dormers / chimney pots / TV aerials / climbing roses / window boxes / wrought-iron balconies / stepped lane / wet street reflection / gouache and ink cityscape / pastel vignette / soft pastel character / chalk pastel portrait / pastel textures and painterly brushstrokes / whimsical character design / picture-book character on white / person with a pet / girl and her cat / ginger cat / cat scarf / big round eyes / rosy cheeks / red-tipped nose / wispy hair strands / fluffy fur / feathered edges / vignette on white paper / Midjourney sref 455581803 look without an image model / poetic halloween / halloween portrait / autumn night portrait / melancholic picture book / surreal storybook portrait / porcelain face / red flush round the eyes / red-rimmed eyes / red nose / heavy-lidded sad eyes / blunt black bob / straight fringe / silver bob / burlap hat / felt hat / chunky knit scarf / knitted mittens / tartan coat / plaid coat / sheet ghost / little glowing ghosts / ghost in a jar / glowing eyes / dark foliage / starry night sky / Midjourney sref 3822619412 look without an image model" 时使用;也用于需要逐步画出(draw-on)动画的插画。单独说「剪纸」指剪纸拼贴、「刺绣」指十字绣、「丝网印刷 / screen print」指包豪斯几何;「打马赛克」是打码,不是马赛克画风;单说「蓝图」指蓝图工程图,「蓝晒 / 晒图」仍指蓝晒;「铅笔 / 素描」指铅笔素描,「彩铅」指韩国彩铅;「像素」仍指像素风,「1-bit / 黑白画图软件」指 1-bit 早期画图软件;「霓虹」仍指赛博朋克;「喷漆 / 街头涂鸦」仍指喷漆模板涂鸦,「圆珠笔 / 随手涂鸦 / 页边涂鸦」指圆珠笔涂鸦;「描图纸 / 硫酸纸 / 叠片 / 灯箱」指描图纸叠层(蓝图工程图那张描图布是晒成蓝图的,不是叠片);「Dot 风 / 粉彩界面 / 窗口卡片 / 发布会界面」指粉彩界面(纯色底 + 白色实心窗口卡片),要磨砂玻璃和弥散渐变仍用弥散玻璃;「阅卷 / 批改 / 答题卡 / 判卷 / 红笔打分」指阅卷批改,实验记录里的红笔圈和便利贴仍用实验笔记本,带「已付」橡皮章的小票拼贴仍用贴纸拼贴 · 小票;「皮影 / 皮影戏 / 影子戏」指皮影戏(透光的彩色驴皮人偶),黑纸剪出的侧影小像仍用剪影,彩纸剪贴仍用剪纸拼贴。「钢笔淡彩 / 淡彩速写 / 针管笔加水彩 / 线稿上色的速写小卡」指钢笔淡彩;单说「水彩」仍指水彩(风景、花卉的大片晕染),蓝铅笔稿 + 毛笔线 + 赛璐璐阴影的拟人小物仍用卡通手绘,「素描 / 铅笔」仍指铅笔素描。「水粉 / 复古水粉 / 绘本大头像 / 复古童书插画」指复古水粉(不透明水粉画的特写大头像);梵高式厚涂的风景、名画感仍用油画厚涂,扁平矢量、会挤压拉伸的小角色动画(「绘本动画」)仍用绘本角色动画,针管笔线稿加淡彩的速写小卡仍用钢笔淡彩,撞色多格的头像仍用波普丝网。「蓝调绘本 / 软蓝绘本 / 蓝色童书插画 / 绘本跨页」指蓝调绘本(软蓝限色的现代绘本跨页:干笔墨线 + 干蜡笔粉彩上色 + 白粉笔痕);单说「绘本」仍指绘本角色动画,「水粉 / 绘本大头像」仍指复古水粉,「编辑风 / Riso」仍指编辑风手绘,针管笔线稿加淡彩的速写小卡仍用钢笔淡彩,小孩自己画的蜡笔画仍用儿童蜡笔画。「江南园林 / 园林春景 / 中式园林插画 / 粉墙黛瓦 / 飞檐 / 月洞门 / 九曲桥」指江南园林(细笔数字水粉的园林春景:叶形小笔触堆出的繁茂树冠、繁花、垂柳、黛瓦飞檐、碧水倒影、层层远山);单说「水墨 / 山水」仍指水墨,单说「水彩」仍指水彩,动漫背景 / 赛璐璐天空仍指日本动漫,浮世绘仍是浮世绘;梵高式厚涂的风景仍用油画厚涂,皮影人偶的一场戏仍用皮影戏。「干刷色块 / 干笔色块 / 滚筒色块 / mid-century 海报插画」指干刷色块(米白纸上几大块干笔或滚筒刷出的限色色块,人物拆成几个大块面,背后一块纯色板、一旁一个小红方块);单说「水粉 / 绘本大头像」仍指复古水粉,「剪纸 / 彩纸拼贴」仍指剪纸拼贴,「丝网印刷 / screen print」仍指包豪斯几何,「Riso / 编辑风」仍指编辑风手绘,没有笔触的平滑几何色块仍用扁平矢量。「暮色微缩绘本 / 暮色绘本 / 黄昏转夜 / 昼夜交界 / 野花坡 / 细节放大图」指暮色微缩绘本(粉彩黄昏转入银河夜空、拼布山丘、几万朵小野花、很小的原创角色,加圆形放大图和手写小字);单说「绘本」仍指绘本角色动画,「蓝调绘本 / 软蓝绘本」仍指蓝调绘本,赛璐璐天空和夏日少年感仍用日本动漫,大片晕染的风景仍用水彩,整页的机械分解手稿仍用达·芬奇手稿,剖面和施工图仍用蓝图工程图。「排线夜景 / 彩铅或色粉夜景 / 短笔触夜空 / 夜景小版画 / 熔岩入海 / 精灵闪电 / 被照亮的云」指排线夜景(满画面顺着风向的短笔触、深蓝夜色里只有一个暖光、发光的丝和火星、碎的倒影、很小的人,装成带纸边和铅笔字的小版画);梵高式的厚涂漩涡和颜料浮雕仍用油画厚涂,明亮可爱的彩铅甜品仍用韩国彩铅,黑白石墨排线仍用铅笔素描,粉彩黄昏转入银河星空、满坡小野花仍用暮色微缩绘本,霓虹雨夜街道仍用赛博朋克。「Obsidian 风 / 笔记应用界面 / 深色笔记软件 / 双链笔记 / 关系图谱 / mermaid 代码块渲染成图」指笔记应用界面(深色主题的笔记应用窗口:文件列表、Markdown 正文、代码块切到阅读视图渲染成流程图、亮紫光点的关系图谱,只有一个紫色强调色);明亮的粉彩底和白色窗口卡片仍用粉彩界面,点阵无限白板上的卡片和弯曲连线用白板卡片,暖白纸面上的浅灰卡片图表用 Flexoki 纸面,磨砂玻璃和弥散渐变仍用弥散玻璃,绿屏荧光字符的老终端仍用绿屏终端 CRT,霓虹全息的未来界面仍用赛博朋克。「白板卡片 / 无限白板 / Canvas 视图 / 卡片和连线 / 点阵白板 / 分组框 / 带箭头的弯曲连线」指白板卡片(深色应用窗口里随镜头平移缩放的点阵白板:分组框、彩色边卡片、带箭头和标签的弯曲连线、清单 / 引用 / 草图卡片、右上角缩放按钮);笔记正文页、文件列表和关系图谱仍用笔记应用界面,暖白纸上的流程图、时序图和图表仍用 Flexoki 纸面,明亮的粉彩产品界面和检查结果仍用粉彩界面,一层层叠起来的图解仍用描图纸叠层。「Flexoki / Flexoki 纸面 / 暖白纸上的图解页 / Mermaid 那样的流程图、时序图、饼图、柱状图、对比表 / 讲解片里的图表页」指 Flexoki 纸面(暖白纸、墨黑字、不描边的浅灰圆角卡片,卡片里的图照轻量图表渲染器画:灰边框、墨线小三角箭头、普通标签,强调色只点在有意义的地方);手写粉笔的示意图仍用黑板板书,铅笔图表、荧光笔和便利贴仍用实验笔记本,彩色粉彩底、macOS 窗口和 ✓ / ✗ 徽章的产品界面仍用粉彩界面,深色笔记应用窗口仍用笔记应用界面,点阵无限白板上的卡片和连线仍用白板卡片,系统的微缩模型仍用等轴 2.5D,剖面和施工图仍用蓝图工程图。「暖调彩铅绘本 / 彩铅绘本 / 彩铅童书插画 / 巨物与小孩 / 大龟过河 / 纸齿白点 / 层层叠涂」指暖调彩铅绘本(暖白纸上满画面顺形体的彩铅叠涂、纸齿透出细白点、毛发成簇顺毛,大而温柔的生物和小小的孩子,黄昏暖光和橙黄的灯,没有墨线和黑色);单说「彩铅」仍指韩国彩铅(明亮可爱的甜品小物、粉嫩高光),黑白石墨仍用铅笔素描,软蓝限色、刮擦墨线加蜡笔颗粒的绘本跨页仍用蓝调绘本,粉彩黄昏转入星空、满坡小野花仍用暮色微缩绘本,不透明水粉的特写大头像仍用复古水粉,深蓝夜色里只有一个暖光的排线小版画仍用排线夜景;单说「绘本」仍指绘本角色动画。「彩色小镇 / 彩色房子 / 童话小镇 / 童话街景 / 彩旗街 / 钟楼小镇 / 水粉加描线的街景 / 有被这彩色小镇治愈到」指彩色小镇(水粉平涂加细墨线,密密的彩色房子堆上山坡,石板曼莎屋顶、白色钟楼、好几层三角彩旗、爬藤玫瑰和窗台花、湿街倒影);中式园林和古镇仍用江南园林,锡釉蓝砖上的运河小镇仍用代尔夫特蓝瓷砖,黑白刻版的雪村仍用黑白麻胶版画,彩纸剪出来的热气球小镇仍用剪纸拼贴,系统的微缩模型和小岛仍用等轴 2.5D,针管笔速写加淡彩的小卡仍用钢笔淡彩,水粉画的人物大头像仍用复古水粉,彩铅叠出来的黄昏小镇和巨物仍用暖调彩铅绘本,没有描线、没有笔触的几何色块仍用扁平矢量。「色粉小像 / 色粉画 / 绘本角色小像 / 人和宠物 / 猫围巾 / 白底不画背景、边上干笔散开的角色 / 大眼睛大腮红红鼻尖」指色粉小像(白纸上的半身角色小像,软色粉加一点水粉,大圆眼、大腮红、红鼻尖、一根根的发丝和蓬松的毛,柔和的粉蓝和奶油色里只有一组暖橙,边缘散进白纸);背后刷一块单色、看得见毛衣针脚的复古童书大头像仍用复古水粉,满画面彩铅叠涂、带天空和场景的黄昏绘本页仍用暖调彩铅绘本,软蓝限色、乱线墨线的绘本跨页仍用蓝调绘本,针管笔线稿加淡彩的速写小卡仍用钢笔淡彩,明亮可爱的彩铅甜品小物仍用韩国彩铅;「色粉夜景」仍指排线夜景,「粉彩界面」仍指产品界面。「诗意万圣夜 / 万圣节绘本 / 忧郁的瓷白脸 / 红眼眶红鼻头 / 黑色齐刘海波波头 / 粗麻帽子 / 发光的小幽灵」指诗意万圣夜(暗色画板上忧郁、超现实的秋夜绘本肖像:瓷白的脸泛红晕、半闭的厚眼皮、一整块的波波头、粗麻 / 针织 / 格子呢织物,靛蓝星空或深色叶丛里只有一处发光的点睛);白纸上不画背景、色调粉粉的角色小像仍用色粉小像,背后刷一块单色、大鼻子红脸蛋的复古童书大头像仍用复古水粉,满画面短排线、只有一个暖光的夜景小版画仍用排线夜景,粉彩黄昏转入星空的微缩风景仍用暮色微缩绘本,满画面彩铅叠涂的温暖黄昏童书页仍用暖调彩铅绘本。+description: Claude 绘图 / Claude Drawing —— 不借助任何生图模型,由 Claude 用代码一笔一笔「画」出图片(程序化绘画)。内置七十八种画风:中国水墨、水彩、剪纸拼贴、韩国彩铅、日本动漫、编辑风手绘(Riso)、油画厚涂(梵高式流向笔触+颜料浮雕打光)、浮世绘木版画(晕色、木纹、墨线主版、青海波)、像素风(低分辨率+Bayer 抖动+像素字体)、黏土定格(高度图捏出的彩泥+影棚打光)、蓝晒(普鲁士蓝日光晒图,植物剪影透光)、十字绣(Aida 布十字绣+回针绣+缎面绣+法式结)、复古仪器面板(60 年代收音机/仪器正面:柚木、拉丝铝、旋钮、刻度窗、指示灯)、贴纸拼贴·小票(模切乙烯贴纸、热敏小票、和纸胶带、吊牌、橡皮章)、实验笔记本·贴纸(线圈方格本、铅笔图表、荧光笔、红笔圈、便利贴)、黑板板书(墨绿石板、粉笔颗粒、板擦残影、示意图与公式)、赛博朋克(雨夜霓虹街道、玻璃管霓虹招牌、全息广告、湿路面倒影)、卡通手绘(蓝铅笔稿、毛笔线、错位平涂、赛璐璐阴影、逐帧抖线)、等轴 2.5D(正等轴微缩模型、一个太阳照出三面明暗、悬浮数据卡)、单线画(一根不断开的线一笔画完、唯一点睛色)、柔光 3D(光线追踪的糖果色小球海和鼓鼓的软字、景深)、形变动画(一条轮廓依次变形、洋葱皮残影、缓动曲线)、报刊拼贴(牛皮纸、手撕旧报纸、网点老照片、勒索信拼贴字)、弥散玻璃(弥散渐变、磨砂玻璃卡片界面)、包豪斯几何(三原色几何、丝网印刷海报)、复古 Synthwave(切口落日、霓虹网格、镀铬字、录像带质感)、拼豆(钉板上的熔珠小管、熨烫熔合)、岩画(沙漠漆上凿出的凹坑图形、新旧凿痕、剥落)、古埃及墓室壁画(灰泥墙、红格起稿、分栏叙事、象形文字、剥落)、罗马马赛克(石子与玻璃沿轮廓一排排铺、灰缝、燕尾铭牌)、彩色玻璃花窗(哥特尖拱窗、通体着色玻璃、grisaille 彩绘与银染、铅条、透光)、泥金手抄本(羊皮纸、鹅毛笔哥特体、朱红标题、打磨金箔首字母)、达·芬奇手稿(铁胆墨水、左手排线、红粉笔、镜像手写、机械分解图)、剪影(黑纸剪出的侧影小像、薄金粉、椭圆金框)、凸版印刷海报(木活字、红黑双色错版、木刻插图)、苏联构成主义(红黑两版、斜条与楔形、西里尔大字、网点照片拼贴)、装饰艺术 Art Deco(1930 年代喷枪流线型海报、交替射线、阶梯高楼、金色 Deco 字)、黄金时代漫画(毛笔墨线、Ben-Day 网点、四色错版、新闻纸)、波普丝网(多格撞色平涂 + 错位的照相黑版)、ASCII 字符画(行式打印机、绿条连续纸、叠打)、低多边形(1999 年代 3D:平面着色、仿射贴图、逐顶点雾、15 位色抖动)、喷漆模板涂鸦(混凝土墙上多层卡纸模板喷绘、雾化与滴痕)、刺绣徽章(牛仔布上的机绣徽章:填充绣、缎面绣、锁边)、蓝图工程图(描图墨线晒成蓝底白线)、儿童蜡笔画(小孩在糙纸上的蜡笔涂抹)、绿屏终端 CRT(荧光字符画、扫描线、余辉)、热成像(先画温度场再上伪彩色)、代尔夫特蓝瓷砖(锡釉砖上的钴蓝手绘)、洞穴壁画(火光下的赭石、吹喷手印)、1-bit 早期画图软件(黑白整屏、8×8 图案填充)、古希腊黑绘陶瓶(黑釉剪影、刻线、饰带展开图)、铅笔素描(石墨排线、擦笔、边缘只剩线稿)、X 光片(安检透视、轮廓发亮、伪彩)、1930 年代黑白橡皮管动画(白手套、饼切眼、老胶片)、黑白麻胶版画(刻刀减法、手拓发花、套色错版)、VHS 家庭录像(钨丝灯偏色、色度渗色、REC)、扁平矢量(分层几何色块、七色、层间投影)、绘本角色动画(小角色挤压拉伸的真动画)、圆珠笔涂鸦(蓝红圆珠笔线稿、墨团、彩铅、页边涂鸦)、描图纸叠层(灯箱上的黑线底图 + 一张张单色描图纸叠片:正片叠底、套准十字、定位钉、绘图胶带)、粉彩界面 · Pastel UI(产品发布片式的界面画面:纯色粉彩底与大光斑、macOS 窗口卡片、胶囊与粗黑标题色条、状态标签与 ✓ / ✗ 徽章、放大镜、从卡片边探头的扁平小图标)、阅卷批改 · Exam Grading(绿毛毡桌上被红笔批改的答题卡:定位黑块、考号涂卡、得分格与阅卷栏、长尾夹夹住的标准答案卡、油墨不均的朱红印章、立体红笔、波浪线 / 圈 / 引线 / 批注 / 叉 / 圈起来的分数)、皮影戏 · Shadow Puppetry(油灯照亮的幕布上,雕空、透明染色的驴皮关节人偶:镂空纹样、阳刻空脸、雉翎盔头、线结与操纵杆、离幕时虚化的双影;雕花戏台、红漆金字牌匾、红灯笼)、钢笔淡彩 · Pen & Wash(速写小卡上的针管笔线稿 + 松散淡彩:线条抖、出头、不闭合,颜色错位出线、留白缝、干边与颗粒,不铺满的背景色块;大头、圆眼镜、点点眼、红鼻子的呆萌小人;卡片拍在木桌上,旁边放着针管笔和水笔)、复古水粉 · Retro Gouache(复古绘本风的水粉大头像:不透明水粉从暗到亮一层层盖上去,单色背景用干笔皴擦;大红鼻子、腮红、圆眼和大耳朵用几阶色值塑出来;看得见针脚的毛衣和毛线帽,一根根的头发和胡子,毛毡;最后是印刷书页的纸纹)、蓝调绘本 · Blue Picture Book(软蓝色调的现代绘本跨页:几乎只用粉蓝、矢车菊蓝、深青蓝三阶蓝加黑墨和纸白,只点一点珊瑚红、粉色腮红和芥末黄;毛笔 / 墨铅笔线干、抖、断,粗细不匀,线不闭合,暗部用快速来回的乱线排出来;颜色是干蜡笔、粉彩、干水粉,错位出线,纸纹的白点透出来;白粉笔痕压在蓝上,甩点和细尘;背景蓝块毛边、不到纸边;大圆脑袋、带高光的点点眼、点彩腮红和雀斑、火柴腿穿靴子的小人,乱线毛边的白色毛绒动物;最后印在书上:中缝和页码)、江南园林 · Jiangnan Garden(细笔园林春景,数字水粉插画:成千上万片叶形小笔触按一个太阳堆出树冠,暗芯、亮边、一簇簇的高光;白色和淡粉的繁花是一簇簇圆点花瓣,枝条从缝里露出来;垂柳是一绺一绺发丝般的细枝挂满小叶;黛瓦飞檐是真的瓦垄:筒瓦板瓦一行行、檐口瓦当滴水、翘起的翼角和卷起的脊头;粉墙月洞门、冰裂纹漏窗、翡翠绿槅扇和挂落、红灯笼、匾额;九曲石桥、石阶、小木船;碧绿湖面倒映岸上的一切,更柔、更暗,加涟漪和细竖纹;睡莲、白鹭;从前景花枝到雾里青山层层退远,墙上桥上落着叶影;最后一方小红印)、干刷色块 · Dry-Brush Blocks(mid-century 海报 / 水粉拼贴式的编辑插画:米白纸上几大块干笔或滚筒刷出的色块,颜色严格限定在森林绿、鼠尾草绿、青蓝、藏蓝、近黑和朱红,外加一点天蓝、淡青瓷和米色;每块颜色在自己的笔刷坐标系里刷:一道道平行的笔,起笔饱满、收笔干枯,两侧几乎是直边,两端梳成长短不一的毛齿,块里有顺笔的鬃毛纹、皴擦斑和露出来的纸色;背后的大色板用滚筒:近乎平涂、成簇的细点、干的两侧和几道细刮痕;色块像丝网套印或撕纸拼贴一样叠起来,撕口带一圈浅色纤维边;人物拆成几个大块面:亮暗两半朝不同方向刷的外套、几块肤色平面拼的头、粗黑框眼镜、干笔皴擦的白胡子;瓶子是竖刷的深色剪影加一道高光和小块标签;一旁一个小朱红方块;不勾线、不做渐变;最后像胶印:轻微柔化、纸纹、暗部零星白点、纸上细尘)、暮色微缩绘本 · Twilight Storybook(温柔、怀旧的黄昏绘本单页,满是微缩细节:大片粉彩黄昏天空,从顶上的薰衣草紫经玫瑰、蜜桃到地平线的暖金,柔和的平底云带、细细的光线和一轮低垂的淡日;一侧天空已经入夜:星空、带暗带的银河、弯月、流星,昼夜交界经过淡紫和靛蓝,不发灰;下面是一层层粉彩条纹的起伏山丘,拼布似的田、细细的垄、小圆树;前景是几万朵小野花铺成的坡,坡顶是色点,越往下越大:雏菊、矢车菊、虞美人、波斯菊、金盏花、毛茛、羽扇豆、勿忘我,夜的一侧整片变成月光蓝;很小、扁平、可爱的原创角色;上面叠一层科学图版的语言:圆形的「detail a」放大图,细墨线、排线、尺寸标注、标签和比例尺,几行灰色的小写英文手写字;最后是细颗粒、光晕、暗角和底边一道撕纸边)、排线夜景 · Hatched Nocturne(彩铅 / 色粉排线式的小幅夜景版画:天空、云、山和海全由密密的短笔触叠成,每片区域的笔触顺着同一股「风」走——天空斜着流、蒸汽绕着云团卷、山坡顺着坡向、海面横着长拖,每一笔色相和明度都差一点,笔毛分道、拖干的笔尾、纸纹里漏出的细缝,没有一处平滑渐变;深靛蓝、藏青、冷灰蓝的夜色里只有一个暖色光源,光是一层层加上去的发光笔触:核心黄白、外圈橙红、再外是被照亮的笔触,被照亮的蒸汽按「光 × 受光」上色,所以是红橙而不是粉;发光的细丝(会蜿蜒、分股、末端亮珠)、火星、星点;海面上被横向笔触打碎的倒影和光柱;几十像素高的小人靠一点亮色(围巾)点出来;最后装裱成小版画:米白纸边、压印的版痕、左下铅笔小标题、右下更小的说明,用细的普通字体)、笔记应用界面 · Obsidian UI(讲解片里的深色笔记应用窗口:近黑页面上一团淡紫光晕,窗口里有标签栏、细长图标栏、带缩进线的文件列表、粗黑 H1 下一道紫色短条、属性块和「#标签」、紫色的内部链接和行内代码、带语法色的 mermaid 代码块——点「阅读」后渲染成扁平深色的流程图,一个节点亮紫——紫色左边的引用标注,右栏关系图谱里被链接的笔记亮成紫色光点;全画只有一个紫色强调色,不画官方 logo)、白板卡片 · Canvas Board(深色笔记应用的白板视图:深色页面上一扇应用窗口——红黄绿三点和「.canvas」标签页的标签栏、左边一列线性图标——里面是一块随镜头平移缩放的灰点阵无限白板;分组框和浮在框上方的组名,深色圆角卡片带 2 px 的卡片色边(红、橙、黄、绿、青、紫)和一层很淡的同色底,卡片之间是从边的中点沿法线弯出去的曲线连线,末端实心箭头、中间一块白板底色的标签;卡片里是 Markdown:标题、正文、紫色高亮、等宽行内代码、勾选清单(勾上时紫色方框弹出、对勾画出、文字变灰加删除线)、紫色竖条的引用、紫色标签胶囊、颜色编号胶囊;图片卡片上方写文件名,里面可以用手绘笔触画草图(每笔画两遍、略弯、出头,手写体批注);右上角一列缩放按钮;全画只有一个紫色强调色加卡片色;所有东西都记在白板坐标里、每次按镜头重画,任意缩放都锐利,镜头能平移缩放、卡片能掉落、连线能一点点画出来)、Flexoki 纸面 · Flexoki Paper(文档站式的图解页:暖白纸(#FFFCF0) 上的墨黑字和一串暖灰,几张不描边、不投影的浅灰圆角卡片,粗黑中文标题、灰色英文类型名、等宽编号;卡片里的图照轻量图表渲染器的样子画——比底色差一级的框和 2 px 灰边(直角、圆角、胶囊、菱形、圆柱、圆)、墨线末端一个小的实心三角箭头、普通半粗体标签垫一块底色,虚线生命线和回复、带纸色缝的饼图、细网格上的柱状图、表头着色的对比表;Flexoki 的橙、红、蓝、绿、紫、青只放在有意义的地方,橙色聚焦框、黑底胶囊、字距收紧的大数字;能做成图一边一边画出来、数字滚动的动图)、暖调彩铅绘本 · Warm Pencil Storybook(暖白、有齿纹的纸上一层层叠涂的彩色铅笔绘本页:天空、山坡、草、水、一只大而温柔的生物和一个小小的孩子,全由顺着形体走向的细铅笔线叠成——天空横向长排线,山坡顺着坡势,龟壳绕着每块盾片的生长纹,脖子横过褶皱,雨衣顺着衣褶,苔藓和头发一簇簇顺毛;每块先铺一层浅色底,再上固有色、背光处叠同色系的深色,受光处罩一层暖色、阴影里罩一层冷色,每层角度错开一点、笔触交叉;蜡只挂在纸齿的峰上,同一批纸坑一层层都透出细白点,压得重、叠得多的地方才慢慢合上;后画的东西先留白再铺背景,颜色不互相混;毛是一绺一绺的:根部散开、尖端聚拢、顺着毛向,每绺受光一侧亮、背光一侧暗;没有墨线、没有黑色,只有很淡的同色轮廓;黄昏的暖光:灯笼和窗灯是一层层橙黄的发光叠涂(不是一团光晕,也不是放射线),低低的太阳给受光一侧一道暖边;水里的倒影也是一笔笔横排线;附带树、小房子、石头、鳞片、野花、纸灯笼和穿雨衣提灯笼的小孩等绘本部件)、彩色小镇 · Colour Town(不透明水粉平涂加细细的深棕墨线画的童话山城街景:高高窄窄的房子漆成番茄红、芥末黄、青绿、薄荷、珊瑚、奶白,一排压一排堆上山坡,近大远小、前后遮挡;深蓝灰的石板曼莎屋顶是一片片瓦错缝铺出来的,带老虎窗、烟囱和赤陶烟囱帽、电视天线;白色钟楼、淡蓝的天和奶白的云;三角彩旗串在好几层深度上斜穿街道,远处的小、近处的大,每面旗有一道深一点的折痕;红色爬藤玫瑰、溢出来的窗台花箱、铁艺阳台、石头台阶和扶手、路灯、吊挂的店招、拱门和彩色木门、写着字的店面和条纹遮阳篷;前景是湿亮的街面,把整条街倒映成一道道竖向的笔触;每块颜色都是带一点笔刷纹理的不透明平涂,边缘像手画的那样微微抖,和描线不完全对齐;墨线分成几段、粗细略有变化,方框的转角偶尔出头;墨是半透明的,压在红墙上是深红棕,压在玻璃上近乎黑;窗户排得整齐,但每扇都略有不同;一整面墙可以用透视单应贴成往消失点收的峡谷墙;几乎没有投影;附带钟楼、台阶、矮墙、栏杆、树、花盆、彩旗、路灯、店招、海报、咖啡桌、猫和概括的小人等部件)、色粉小像 · Pastel Vignette(白纸上的绘本角色小像,软色粉加一点水粉:一个人和他的小动物,半身、略偏一边,四周大片留白,不画背景色块、不加边框,画面在边上用干笔散开、融进白纸;颜色柔和、粉粉的——浅粉蓝的衣服上看得见顺着衣褶的干笔、奶油色的毛衣、暖肤色——只有一组暖橙饱和(橘猫、绒球、蝴蝶结这类);脸是揉开的平滑色粉:大圆眼、深色虹膜和两点白高光、一大圈腮红、红鼻尖、小嘴;头发和毛是成百上千根细丝,一绺一绺,有几根飞出轮廓,毛的轮廓蓬松地融进后面的东西;几乎不描线,只有眼皮、鼻翼、脸的背光侧几道细的软线;背后至多一枝叶子和一层很淡的铅笔小镇;附带圆眼、眉毛、腮红、鼻子、嘴、发丝、毛簇、蓬松轮廓、叶子和枝条等部件)、诗意万圣夜 · Poetic Halloween(忧郁、带一点超现实的秋夜 / 万圣节绘本肖像,暗色画板上的不透明水粉加细彩铅排线,再印出来:瓷白的脸,鼻子、脸颊、眼皮和眼睛四周泛着很重的红晕(平滑的一层红加单像素的细红斑点),下眼睑一道湿红,厚眼皮半闭、往外眼角垂,小嘴不笑,体积极简;头发是一整块雕塑般的实体——刀切一样平的齐刘海、乌黑(或银白)的波波头,几乎看不见发丝,只有一道柔和的光泽;衣物是摸得着的织物:粗麻 / 毛毡帽子(一上一下交织的粗线、线间的黑孔、毛边)、粗针织围巾和手套、斜纹织出来的格子呢外套;底子暗而沉——靛蓝夜空和星星、浓密的深色叶丛;每幅只有一处发光的点睛:眼睛和衣摆尖发着暖光的床单小幽灵,暖光照亮身边的叶子、毛线和脸的下侧;满画面一层细的印刷颗粒;附带重眼皮眼、红晕、长鼻子、小嘴、光泽带、粗麻、针织、罗纹、格子呢、毛边、掌状叶和叶丛、暖光照明和光晕、小幽灵、星星等部件)、油画棒肖像 · Oil-Pastel Portrait(白色糙面纸上的油画棒 / 蜡笔干刷人物小像,人浮在白纸上、不画背景(至多一抹天色或一块干刷的黑色投影):颜色收得紧而浓——藏红花黄 / 金盏黄、偏青的藏青和黑、一种冷蓝,加橙色腮红和橙红嘴唇;毛衣、帽子、大衣、围巾这类大块颜色用一道道平行的干笔铺满,蜡只挂在纸纹的凸起上、跳过纸坑,所以每块颜色里都撒着顺着笔拉长的纸纹白点,笔触的收尾是硬的、一把长短不一的梳齿;黑色蜡笔只点在要紧处:眼睛、眉毛、鼻孔、几笔轮廓和衣褶,不勾满轮廓线;脸就是纸本身,背光一侧几笔桃色,两块排线的橙色腮红,平涂的橙红嘴唇——简化、略歪、有表情;头发是几笔松而有劲的长笔触,针织的条纹是一段段短而粗的色条;附带干笔铺色、蜡笔线、排线腮红、短色条、干刷投影、热气、黑眼睛、粗眉、嘴唇、长发丝等部件)。用户说「claude绘图」「用代码画」「你自己画」「不用生图模型画」「程序化绘画」,或点名以上任一画风(含黏土、彩泥、定格动画、蓝晒、晒图、十字绣、刺绣、复古面板、老式收音机、贴纸、小票、收据、手帐拼贴、实验笔记本、方格本、荧光笔、便利贴、黑板、板书、粉笔、赛博朋克、霓虹、雨夜街道、卡通、手绘卡通、逐帧手绘、抖线、等轴、2.5D、微缩模型、单线画、一笔画、线条动画、柔光 3D、3D 渲染、C4D 风、软糖字、小球海、形变、变形动画、报刊拼贴、剪报、达达、勒索信字、网点印刷、弥散渐变、玻璃拟态、毛玻璃、包豪斯、几何构成、丝网印刷、Synthwave、蒸汽波、合成器浪潮、80 年代复古、拼豆、拼拼豆、熔珠、熨豆、豆豆画、钉板、烫豆、岩画、岩刻、凿刻、石刻、沙漠漆、史前壁刻、大角羊、古埃及、埃及壁画、墓室壁画、法老时代、象形文字、尼罗河、底比斯、罗马马赛克、马赛克镶嵌、镶嵌画、石子拼画、地砖画、古罗马地板、彩色玻璃、彩绘玻璃、花窗、玻璃花窗、教堂花窗、哥特花窗、铅条玻璃、泥金手抄本、手抄本、彩饰手抄本、中世纪手稿、羊皮纸、哥特体、花体首字母、泥金、贴金、星盘、达芬奇、达·芬奇、达芬奇手稿、手稿风、文艺复兴手稿、发明手稿、镜像字、镜像书写、扑翼机、红粉笔、钢笔排线、机械草图、分解图、剪影、剪影肖像、侧影、侧面像、黑纸剪影、剪影小像、椭圆金框、乔治时代肖像、摄政时期肖像、凸版印刷、活版印刷、木活字、铅字海报、马戏团海报、复古海报、老海报、19 世纪海报、双色套印、错版、套色错位、木刻插图、构成主义、苏联海报、苏联构成主义、俄国先锋派、罗德琴科风、红黑海报、照片蒙太奇、照片拼贴海报、西里尔字、装饰艺术、装饰风、流线型、流线型海报、1930 年代海报、旅行海报、铁路海报、火车海报、喷枪画、喷笔画、阶梯高楼、射线背景、盖茨比风、黄金时代漫画、老漫画、复古漫画、美漫封面、漫画封面、Ben-Day 网点、本戴点、网点上色、四色印刷、四色错版、新闻纸、对白框、拟声字、1940 年代漫画、波普、波普艺术、波普丝网、沃霍尔风、丝网版画头像、撞色头像、多格重复头像、六宫格撞色头像、ASCII、字符画、字符艺术、文字画、行式打印机、绿条纸、连续打印纸、针孔打印纸、老电脑打印、叠打、低多边形、低面数、低模、多边形风、千禧年 3D、90 年代 3D、复古 3D 游戏、老游戏截图、PS1 风、N64 风、平面着色、线框、游戏 HUD、飞行游戏、穿环、喷漆、模板涂鸦、镂空模板、喷漆模板、模板喷绘、街头涂鸦、街头艺术、墙绘、滴漆、班克西风格、刺绣徽章、徽章、布章、臂章、刺绣贴、绣标、锁边、牛仔外套徽章、户外徽章、营地徽章、弧形条章、蓝图、工程图、施工图、蜡笔画、儿童画、绿屏终端、CRT、显像管、热成像、热像仪、温度图、代尔夫特、荷兰蓝瓷砖、洞穴壁画、史前壁画、赭石、1-bit、黑白画图软件、MacPaint 风、黑绘、古希腊陶瓶、希腊瓶画、铅笔素描、素描、铅笔画、X 光、X 光片、安检图像、橡皮管动画、黑白卡通、老动画、麻胶版画、黑白版画、藏书票、VHS、家庭录像、录像带、扁平插画、扁平风、矢量插画、绘本动画、角色动画、挤压拉伸、圆珠笔、圆珠笔涂鸦、原子笔、页边涂鸦、课本涂鸦、手画棋盘、描图纸、硫酸纸、叠片、叠层、分色片、灯箱、拷贝台、透光台、套准、定位钉、粉彩界面、粉彩 UI、Dot 风、Dot 那种风格、产品发布会界面、发布会质感、窗口卡片、macOS 窗口、界面卡片、讲解片界面页、小图标探头、阅卷、阅卷批改、批改、判卷、改卷、改作业、答题卡、试卷、考卷、测验卷、红笔批改、红笔打分、打分数、盖章批改、朱红印章、标准答案卡、长尾夹、讲解片评测 / 打分页、皮影、皮影戏、影子戏、驴皮影、灯影戏、皮影人偶、雕花戏台、戏台牌匾、亮相、钢笔淡彩、淡彩、淡彩速写、钢笔淡彩小人、针管笔、勾线笔、针管笔加水彩、线稿上色、速写卡片、速写本小人、水彩小卡、城市速写、街头速写、水笔、自来水笔、复古水粉、水粉、水粉画、不透明水粉、哑光丙烯、复古绘本、绘本插画、绘本大头像、童书插画、复古童书、大头像、大鼻子人物、针织毛衣、麻花毛衣、毛线帽、毛毡帽、卷发、胡子、蓝调绘本、蓝色绘本、软蓝绘本、蓝调童书、软蓝童书插画、蓝色童书插画、蓝色系绘本、限色绘本、蓝白绘本、现代绘本跨页、手绘绘本跨页、绘本跨页、绘本内页、干笔墨线、墨铅笔线、粉彩蜡笔质感绘本、白色毛绒动物、毛绒白熊、点彩腮红、江南园林、园林春景、春水园林、中式园林插画、古典园林插画、国风园林插画、苏式园林、细笔园林、园林风景插画、水榭、临水茶榭、亭台楼阁、粉墙黛瓦、黛瓦白墙、飞檐翘角、翼角起翘、月洞门、漏窗、冰裂纹窗、槅扇、挂落、九曲桥、曲桥、垂柳园林、碧水倒影、园林倒影、睡莲池、数字水粉风景、细腻厚涂风景、干刷色块、干笔色块、干刷、干刷插画、干笔插画、滚筒刷、滚筒色块、色块插画、大色块插画、毛边色块、刷痕色块、粗刷笔触、mid-century、世纪中期插画、中世纪现代插画、复古编辑插画、复古海报插画、水粉拼贴、撕纸色块、限色海报、暮色微缩绘本、暮色绘本、黄昏绘本、微缩绘本、黄昏转夜、昼夜交界、日夜交界、半边黄昏半边星空、粉彩黄昏、粉紫晚霞、黄昏星空、银河插画、野花坡、野花草坡、花海插画、萤火虫、放风筝插画、拼布山丘、条纹田野、小圆树、细节放大图、局部放大图、技术细节小窗、科学图版风插画、手写英文小字、晚安绘本、治愈系绘本插画、排线夜景、排线风夜景、彩铅夜景、色粉夜景、粉彩排线、短笔触夜景、笔触夜空、方向笔触、夜景版画、小版画、限量版画风、版画装裱、版痕、纸边标题、铅笔题字、夜景插画、夜空插画、深蓝夜景、靛蓝夜空、冷暖对比夜景、唯一暖光、夜里的火光、发光的云、被照亮的云、红色精灵闪电、精灵闪电、火山夜景、熔岩入海、熔岩、岩浆、火山喷发插画、海上风暴、海面倒影、光柱倒影、火星飞溅、星点、看海的人、礁石上的人、远处的小人、小人比例尺、雪夜篝火、渔火、笔记应用界面、笔记软件界面、笔记 App 界面、Obsidian 风、Obsidian 界面、Obsidian 风格、黑曜石笔记、深色笔记界面、暗色主题界面、Markdown 笔记、Markdown 编辑器、双链笔记、内部链接、关系图谱、知识图谱界面、图谱视图、局部图谱、反向链接、文件列表、侧边栏、标签页、属性栏、行内代码、代码块、mermaid、mermaid 流程图、代码块渲染成图、源码 / 阅读切换、阅读视图、引用标注、callout、读书笔记界面、知识库界面、第二大脑、讲解片里的笔记应用、应用窗口演示、白板卡片、无限白板、白板视图、画布视图、Canvas 视图、Obsidian Canvas、Obsidian 白板、笔记应用白板、卡片白板、卡片和连线、节点和连线、带箭头的连线、弯曲连线、连线标签、分组框、点阵背景、点阵白板、深色白板、深色界面卡片、彩色边卡片、勾选清单卡片、待办卡片、引用卡片、图片卡片、草图卡片、手绘平面图、缩放按钮、镜头平移、镜头缩放、卡片掉落动画、连线画出来、搬家计划、旅行计划白板、活动计划白板、头脑风暴白板、项目拆解白板、计划白板、Flexoki、Flexoki 纸面、Flexoki 配色、Flexoki 风、暖白纸、米白纸面、墨黑字、文档站风格、文档页图解、技术文档配图、图解页、一页图解、讲解片图表页、几张图讲清楚、流程图、画流程图、时序图、序列图、饼图、柱状图、条形图、对比表、参数对比、图表合集、图表墙、Mermaid 风、Mermaid 图、图表渲染器、灰底圆角框、小三角箭头、橙色聚焦框、数字滚动、计时器大数字、配方图解、步骤图解、手冲咖啡图解、菜谱图解、工作流程图解、暖调彩铅绘本、暖调彩铅、彩铅绘本、彩铅童书、彩铅童书插画、彩色铅笔绘本、彩色铅笔童书、软彩铅、彩铅叠涂、层层叠涂的彩铅、顺着形体排线、纸齿白点、纸纹透白、怀旧童书、翻绘本的感觉、温暖怀旧的绘本、暖色绘本页、巨物与小孩、大动物和小孩、巨大温柔的生物、温柔的巨兽、大乌龟、巨龟、老乌龟、背着花园的乌龟、龟背上的小花园、大龟过河、过河、小溪、踏脚石、提灯笼的小孩、黄色雨衣、纸灯笼、亮灯的窗、亮灯的小房子、黄昏小镇、成簇的毛、顺毛、毛一绺一绺、苔藓、金黄的树、彩色小镇、彩色房子、彩色街景、童话小镇、童话街景、治愈小镇、理想的生活环境、欧洲小镇、山城小镇、钟楼小镇、彩虹小镇、彩旗、三角彩旗、彩旗串、彩旗街、节日街道、节日早晨、钟楼、白色钟楼、洋葱顶、石板屋顶、曼莎屋顶、老虎窗、烟囱帽、电视天线、风向标、爬藤玫瑰、窗台花箱、铁艺阳台、台阶街、石头台阶、拱门下的台阶、湿街倒影、雨后街道、雨后的广场、水粉街景、水粉加描线、水粉平涂加细线、细节多到看不完、小红书彩色小镇、色粉小像、色粉画、软色粉、色粉笔触、色粉质感、色粉加水粉、粉彩笔触、粉彩质感、绘本角色、绘本人物、绘本小像、角色小像、人物小像、半身像、人和宠物、人和猫、人和狗、主人和宠物、抱着猫、抱着狗、橘猫、大橘、毛茸茸的猫、毛茸茸的狗、狐狸、猫围巾、把猫当围巾、白底插画、留白插画、不画背景、边缘散开、干笔散开、画到边上就散了、大眼睛、大圆眼、大腮红、红鼻头、红鼻尖、发丝、一根根头发、头发丝、飞丝、毛绒绒、蓬松的毛、温柔的小像、治愈系角色、Midjourney 色粉风、诗意万圣夜、诗意万圣节、万圣节、万圣夜、万圣节插画、万圣节绘本、万圣节头像、秋夜、秋夜插画、忧郁绘本、忧郁风、超现实绘本、诡异又温柔、瓷白的脸、瓷娃娃脸、瓷偶、脸上的红晕、红眼眶、红眼圈、红鼻头、厚眼皮、半闭的眼睛、悲伤的眼睛、不笑的小嘴、波波头、黑色波波头、银白波波头、齐刘海、刀切刘海、粗麻、麻布、麻袋布、粗麻帽子、毛毡帽、粗针织围巾、毛线手套、格子呢、格纹外套、苏格兰格子、小幽灵、床单幽灵、发光的小幽灵、发光的眼睛、罐子里的幽灵、深色叶丛、星空肖像、Midjourney 万圣风、油画棒、油画棒肖像、油画棒人像、油画棒小像、油画棒插画、油画棒头像、蜡笔肖像、蜡笔干刷、干刷肖像、干刷人像、干笔人物、粗犷笔触、纸纹白点、露白的纸纹、手作感肖像、不完美的肖像、白底人物小像、白纸上的人物、藏红花黄、橙黄配藏青、芥末黄配藏青、条纹围巾、粗针织围巾、露指手套、捧着热饮、冒热气的纸杯、冬天的早市、冬日早晨、冻红的脸颊、橙色腮红、橙红嘴唇、黑色蜡笔线、Midjourney 油画棒风),或 "draw it yourself", "paint with code", "procedural painting", "watercolor / collage / colored pencil / anime / editorial / impasto oil / ukiyo-e / pixel art / clay / claymation / cyanotype / sun print / cross-stitch / embroidery / retro instrument panel / vintage radio / sticker collage / receipt / lab notebook / graph paper / chalkboard / blackboard / cyberpunk / neon city / cartoon / hand-drawn animation / isometric / 2.5D / continuous line / one-line drawing / soft 3D / 3D render / puffy letters / ball pit / shape morph / morphing / newspaper collage / Dada / ransom note / halftone / glassmorphism / aurora gradient / Bauhaus / geometric poster / screen print / synthwave / retrowave / outrun / perler beads / hama beads / artkal / fuse beads / melty beads / pegboard beads / petroglyph / rock art / rock carving / desert varnish / Egyptian tomb painting / ancient Egypt / hieroglyphs / Theban tomb / Roman mosaic / floor mosaic / tesserae / opus vermiculatum / Pompeii mosaic / stained glass / leaded glass / church window / Gothic window / grisaille / illuminated manuscript / medieval manuscript / book of hours / gold leaf / illuminated initial / blackletter / vellum / astrolabe / da Vinci notebook / Leonardo codex / Renaissance sketchbook / mirror writing / iron-gall ink / red chalk / sanguine / ornithopter / exploded view / inventor's sketch / silhouette / silhouette portrait / cut-paper profile / shade portrait / Georgian portrait / Regency portrait / oval gilt frame / letterpress / wood type / playbill / circus poster / Victorian poster / two-colour misregistration / woodcut poster / constructivism / constructivist poster / Soviet avant-garde / Russian avant-garde / Rodchenko style / photomontage poster / art deco / streamline moderne / 1930s travel poster / railway poster / airbrush poster / sunburst rays / Gatsby style / golden age comic / vintage comic book / comic cover / Ben-Day dots / four-color printing / newsprint / speech balloon / pulp cover / pop art / Warhol-style / pop silkscreen / silkscreen portrait / repeated pop portrait grid / ASCII art / text art / typewriter art / line printer / greenbar / fanfold paper / tractor feed / overstrike / printer plot / low poly / low-poly / retro 3D / 90s 3D game / PS1 style / N64 style / software rasterizer / flat shading / affine texture mapping / vertex fog / game HUD / stencil / stencil graffiti / spray paint stencil / street art / drips and overspray / Banksy-style stencil / embroidered patch / embroidery patch / iron-on patch / sew-on patch / merit badge / camp badge / merrow border / rocker patch / denim jacket patches / blueprint / technical drawing / crayon / kid's drawing / CRT terminal / green screen / thermal camera / thermal imaging / Delft tiles / Delft blue / cave painting / ochre / Lascaux-style / 1-bit / MacPaint-style / black-figure / Greek vase / pencil drawing / graphite / X-ray / baggage scanner / rubber hose / 1930s cartoon / linocut / lino print / VHS / home video / flat vector / flat illustration / storybook animation / squash and stretch / ballpoint / biro / ballpoint doodle / margin doodles / hand-drawn board game / overlay sheets / tracing-paper overlays / light box / colour separations / registration marks / acetate overlay / pastel UI / Dot-style product film / launch-film interface / macOS window cards / exam grading / grading an answer sheet / red-pen marking / graded test paper / rubber-stamped answer sheet / shadow puppet / shadow puppetry / Chinese shadow play / leather shadow puppets / backlit puppet screen / pen and wash / pen & wash / line and wash / ink and watercolour / ink and watercolor / fineliner sketch / fineliner and watercolour / sketchbook characters / sketch cards / urban sketching / water brush / gouache / retro gouache / gouache portrait / gouache illustration / opaque gouache / matte acrylic / picture-book portrait / vintage picture book / retro children's book illustration / mid-century children's book / big-nosed character portrait / cable-knit sweater / knitted bobble hat / blue picture book / soft blue picture book / soft-blue children's book illustration / modern picture book / limited-palette picture book / picture-book spread / scratchy ink line / dry-brush ink line / ink pencil line / crayon and pastel texture / chalky white marks / blue and coral palette / fluffy white bear / Jiangnan garden / Chinese garden / classical Chinese garden illustration / Chinese water garden / spring garden illustration / lush painterly garden / waterside pavilion / moon gate / lattice windows / zigzag bridge / weeping willow garden / upturned eaves / grey-tiled roof / blossom trees and reflections / lily pond with egrets / digital gouache landscape / dry-brush blocks / dry brush illustration / dry-brushed colour blocks / roller texture / brush-textured shapes / mid-century illustration / mid-century modern poster / mid-century editorial illustration / gouache collage / torn-paper collage poster / limited palette poster / scumbled texture / vintage book cover illustration / twilight storybook / dusk picture book / dusk to night sky / day and night split sky / pastel sunset sky / Milky Way illustration / wildflower meadow / wildflower hill / patchwork hills / tiny round trees / fireflies / paper kite / magnified detail inset / detail callout circle / scientific plate overlay / handwritten lowercase captions / cozy miniature illustration / bedtime story illustration / hatched nocturne / hatched night scene / pastel hatching night / coloured-pencil nocturne / directional strokes / short brush strokes sky / night print with margins / small art print / plate mark / pencilled title and caption / indigo night with one warm light / glowing cloud lit from below / red sprites / lava entering the sea / volcano at night / glowing threads and sparks / broken reflection on the sea / tiny figures for scale / Obsidian UI / Obsidian-style note app / dark note-taking app / dark-theme Markdown editor / note app window / file explorer sidebar / wiki links / backlinks / graph view / local graph / knowledge graph UI / properties and tags / inline code / mermaid code block / mermaid flowchart rendered / source vs reading view / callout block / reading notes app / second brain UI / knowledge base screen / canvas board / infinite whiteboard / dotted board / note-app canvas view / Obsidian-style canvas / cards and connectors / curved arrows between cards / edge labels / group frames / coloured card borders / task-list card / quote card / image card with a sketch / hand-drawn floor plan / zoom controls / camera pan and zoom / cards dropping in / moving plan board / Flexoki / Flexoki paper / Flexoki palette / warm paper and ink / docs-site diagrams / explainer sheet / diagram sheet / Mermaid-style diagrams / lightweight diagram renderer / flowchart / sequence diagram / pie chart / bar chart / comparison table / diagram wall / grey-bordered boxes / small triangular arrowheads / orange focus ring / rolling numbers / recipe explainer / warm pencil storybook / coloured-pencil storybook / colored pencil picture book / soft pencil textures / layered coloured pencil / pencil strokes following the form / paper tooth specks / nostalgic children's storybook / giant gentle creature and a small child / giant tortoise / tortoise with a garden on its back / stepping stones / child with a lantern / yellow raincoat / paper lantern / lit windows at dusk / tufted fur in locks / Midjourney sref 3220081856 look without an image model / colour town / colorful European town / storybook street / fairy-tale town / candy-coloured houses / hill town / bunting / pennant flags / festival street / clock tower / onion dome / slate mansard roofs / dormers / chimney pots / TV aerials / climbing roses / window boxes / wrought-iron balconies / stepped lane / wet street reflection / gouache and ink cityscape / pastel vignette / soft pastel character / chalk pastel portrait / pastel textures and painterly brushstrokes / whimsical character design / picture-book character on white / person with a pet / girl and her cat / ginger cat / cat scarf / big round eyes / rosy cheeks / red-tipped nose / wispy hair strands / fluffy fur / feathered edges / vignette on white paper / Midjourney sref 455581803 look without an image model / poetic halloween / halloween portrait / autumn night portrait / melancholic picture book / surreal storybook portrait / porcelain face / red flush round the eyes / red-rimmed eyes / red nose / heavy-lidded sad eyes / blunt black bob / straight fringe / silver bob / burlap hat / felt hat / chunky knit scarf / knitted mittens / tartan coat / plaid coat / sheet ghost / little glowing ghosts / ghost in a jar / glowing eyes / dark foliage / starry night sky / Midjourney sref 3822619412 look without an image model / oil pastel / oil-pastel portrait / oil pastel illustration / wax crayon portrait / dry brush portrait / bold dry brush strokes / textured colors / beautifully imperfect portraits / handmade aesthetic / paper tooth showing through / white specks of paper / saffron and navy / mustard and navy / striped scarf / chunky knit scarf / fingerless gloves / steaming paper cup / winter morning portrait / orange blush / red-orange lips / black crayon accents / figure vignette on white / Midjourney sref 2703086978 look without an image model" 时使用;也用于需要逐步画出(draw-on)动画的插画。单独说「剪纸」指剪纸拼贴、「刺绣」指十字绣、「丝网印刷 / screen print」指包豪斯几何;「打马赛克」是打码,不是马赛克画风;单说「蓝图」指蓝图工程图,「蓝晒 / 晒图」仍指蓝晒;「铅笔 / 素描」指铅笔素描,「彩铅」指韩国彩铅;「像素」仍指像素风,「1-bit / 黑白画图软件」指 1-bit 早期画图软件;「霓虹」仍指赛博朋克;「喷漆 / 街头涂鸦」仍指喷漆模板涂鸦,「圆珠笔 / 随手涂鸦 / 页边涂鸦」指圆珠笔涂鸦;「描图纸 / 硫酸纸 / 叠片 / 灯箱」指描图纸叠层(蓝图工程图那张描图布是晒成蓝图的,不是叠片);「Dot 风 / 粉彩界面 / 窗口卡片 / 发布会界面」指粉彩界面(纯色底 + 白色实心窗口卡片),要磨砂玻璃和弥散渐变仍用弥散玻璃;「阅卷 / 批改 / 答题卡 / 判卷 / 红笔打分」指阅卷批改,实验记录里的红笔圈和便利贴仍用实验笔记本,带「已付」橡皮章的小票拼贴仍用贴纸拼贴 · 小票;「皮影 / 皮影戏 / 影子戏」指皮影戏(透光的彩色驴皮人偶),黑纸剪出的侧影小像仍用剪影,彩纸剪贴仍用剪纸拼贴。「钢笔淡彩 / 淡彩速写 / 针管笔加水彩 / 线稿上色的速写小卡」指钢笔淡彩;单说「水彩」仍指水彩(风景、花卉的大片晕染),蓝铅笔稿 + 毛笔线 + 赛璐璐阴影的拟人小物仍用卡通手绘,「素描 / 铅笔」仍指铅笔素描。「水粉 / 复古水粉 / 绘本大头像 / 复古童书插画」指复古水粉(不透明水粉画的特写大头像);梵高式厚涂的风景、名画感仍用油画厚涂,扁平矢量、会挤压拉伸的小角色动画(「绘本动画」)仍用绘本角色动画,针管笔线稿加淡彩的速写小卡仍用钢笔淡彩,撞色多格的头像仍用波普丝网。「蓝调绘本 / 软蓝绘本 / 蓝色童书插画 / 绘本跨页」指蓝调绘本(软蓝限色的现代绘本跨页:干笔墨线 + 干蜡笔粉彩上色 + 白粉笔痕);单说「绘本」仍指绘本角色动画,「水粉 / 绘本大头像」仍指复古水粉,「编辑风 / Riso」仍指编辑风手绘,针管笔线稿加淡彩的速写小卡仍用钢笔淡彩,小孩自己画的蜡笔画仍用儿童蜡笔画。「江南园林 / 园林春景 / 中式园林插画 / 粉墙黛瓦 / 飞檐 / 月洞门 / 九曲桥」指江南园林(细笔数字水粉的园林春景:叶形小笔触堆出的繁茂树冠、繁花、垂柳、黛瓦飞檐、碧水倒影、层层远山);单说「水墨 / 山水」仍指水墨,单说「水彩」仍指水彩,动漫背景 / 赛璐璐天空仍指日本动漫,浮世绘仍是浮世绘;梵高式厚涂的风景仍用油画厚涂,皮影人偶的一场戏仍用皮影戏。「干刷色块 / 干笔色块 / 滚筒色块 / mid-century 海报插画」指干刷色块(米白纸上几大块干笔或滚筒刷出的限色色块,人物拆成几个大块面,背后一块纯色板、一旁一个小红方块);单说「水粉 / 绘本大头像」仍指复古水粉,「剪纸 / 彩纸拼贴」仍指剪纸拼贴,「丝网印刷 / screen print」仍指包豪斯几何,「Riso / 编辑风」仍指编辑风手绘,没有笔触的平滑几何色块仍用扁平矢量。「暮色微缩绘本 / 暮色绘本 / 黄昏转夜 / 昼夜交界 / 野花坡 / 细节放大图」指暮色微缩绘本(粉彩黄昏转入银河夜空、拼布山丘、几万朵小野花、很小的原创角色,加圆形放大图和手写小字);单说「绘本」仍指绘本角色动画,「蓝调绘本 / 软蓝绘本」仍指蓝调绘本,赛璐璐天空和夏日少年感仍用日本动漫,大片晕染的风景仍用水彩,整页的机械分解手稿仍用达·芬奇手稿,剖面和施工图仍用蓝图工程图。「排线夜景 / 彩铅或色粉夜景 / 短笔触夜空 / 夜景小版画 / 熔岩入海 / 精灵闪电 / 被照亮的云」指排线夜景(满画面顺着风向的短笔触、深蓝夜色里只有一个暖光、发光的丝和火星、碎的倒影、很小的人,装成带纸边和铅笔字的小版画);梵高式的厚涂漩涡和颜料浮雕仍用油画厚涂,明亮可爱的彩铅甜品仍用韩国彩铅,黑白石墨排线仍用铅笔素描,粉彩黄昏转入银河星空、满坡小野花仍用暮色微缩绘本,霓虹雨夜街道仍用赛博朋克。「Obsidian 风 / 笔记应用界面 / 深色笔记软件 / 双链笔记 / 关系图谱 / mermaid 代码块渲染成图」指笔记应用界面(深色主题的笔记应用窗口:文件列表、Markdown 正文、代码块切到阅读视图渲染成流程图、亮紫光点的关系图谱,只有一个紫色强调色);明亮的粉彩底和白色窗口卡片仍用粉彩界面,点阵无限白板上的卡片和弯曲连线用白板卡片,暖白纸面上的浅灰卡片图表用 Flexoki 纸面,磨砂玻璃和弥散渐变仍用弥散玻璃,绿屏荧光字符的老终端仍用绿屏终端 CRT,霓虹全息的未来界面仍用赛博朋克。「白板卡片 / 无限白板 / Canvas 视图 / 卡片和连线 / 点阵白板 / 分组框 / 带箭头的弯曲连线」指白板卡片(深色应用窗口里随镜头平移缩放的点阵白板:分组框、彩色边卡片、带箭头和标签的弯曲连线、清单 / 引用 / 草图卡片、右上角缩放按钮);笔记正文页、文件列表和关系图谱仍用笔记应用界面,暖白纸上的流程图、时序图和图表仍用 Flexoki 纸面,明亮的粉彩产品界面和检查结果仍用粉彩界面,一层层叠起来的图解仍用描图纸叠层。「Flexoki / Flexoki 纸面 / 暖白纸上的图解页 / Mermaid 那样的流程图、时序图、饼图、柱状图、对比表 / 讲解片里的图表页」指 Flexoki 纸面(暖白纸、墨黑字、不描边的浅灰圆角卡片,卡片里的图照轻量图表渲染器画:灰边框、墨线小三角箭头、普通标签,强调色只点在有意义的地方);手写粉笔的示意图仍用黑板板书,铅笔图表、荧光笔和便利贴仍用实验笔记本,彩色粉彩底、macOS 窗口和 ✓ / ✗ 徽章的产品界面仍用粉彩界面,深色笔记应用窗口仍用笔记应用界面,点阵无限白板上的卡片和连线仍用白板卡片,系统的微缩模型仍用等轴 2.5D,剖面和施工图仍用蓝图工程图。「暖调彩铅绘本 / 彩铅绘本 / 彩铅童书插画 / 巨物与小孩 / 大龟过河 / 纸齿白点 / 层层叠涂」指暖调彩铅绘本(暖白纸上满画面顺形体的彩铅叠涂、纸齿透出细白点、毛发成簇顺毛,大而温柔的生物和小小的孩子,黄昏暖光和橙黄的灯,没有墨线和黑色);单说「彩铅」仍指韩国彩铅(明亮可爱的甜品小物、粉嫩高光),黑白石墨仍用铅笔素描,软蓝限色、刮擦墨线加蜡笔颗粒的绘本跨页仍用蓝调绘本,粉彩黄昏转入星空、满坡小野花仍用暮色微缩绘本,不透明水粉的特写大头像仍用复古水粉,深蓝夜色里只有一个暖光的排线小版画仍用排线夜景;单说「绘本」仍指绘本角色动画。「彩色小镇 / 彩色房子 / 童话小镇 / 童话街景 / 彩旗街 / 钟楼小镇 / 水粉加描线的街景 / 有被这彩色小镇治愈到」指彩色小镇(水粉平涂加细墨线,密密的彩色房子堆上山坡,石板曼莎屋顶、白色钟楼、好几层三角彩旗、爬藤玫瑰和窗台花、湿街倒影);中式园林和古镇仍用江南园林,锡釉蓝砖上的运河小镇仍用代尔夫特蓝瓷砖,黑白刻版的雪村仍用黑白麻胶版画,彩纸剪出来的热气球小镇仍用剪纸拼贴,系统的微缩模型和小岛仍用等轴 2.5D,针管笔速写加淡彩的小卡仍用钢笔淡彩,水粉画的人物大头像仍用复古水粉,彩铅叠出来的黄昏小镇和巨物仍用暖调彩铅绘本,没有描线、没有笔触的几何色块仍用扁平矢量。「色粉小像 / 色粉画 / 绘本角色小像 / 人和宠物 / 猫围巾 / 白底不画背景、边上干笔散开的角色 / 大眼睛大腮红红鼻尖」指色粉小像(白纸上的半身角色小像,软色粉加一点水粉,大圆眼、大腮红、红鼻尖、一根根的发丝和蓬松的毛,柔和的粉蓝和奶油色里只有一组暖橙,边缘散进白纸);背后刷一块单色、看得见毛衣针脚的复古童书大头像仍用复古水粉,满画面彩铅叠涂、带天空和场景的黄昏绘本页仍用暖调彩铅绘本,软蓝限色、乱线墨线的绘本跨页仍用蓝调绘本,针管笔线稿加淡彩的速写小卡仍用钢笔淡彩,明亮可爱的彩铅甜品小物仍用韩国彩铅;「色粉夜景」仍指排线夜景,「粉彩界面」仍指产品界面。「诗意万圣夜 / 万圣节绘本 / 忧郁的瓷白脸 / 红眼眶红鼻头 / 黑色齐刘海波波头 / 粗麻帽子 / 发光的小幽灵」指诗意万圣夜(暗色画板上忧郁、超现实的秋夜绘本肖像:瓷白的脸泛红晕、半闭的厚眼皮、一整块的波波头、粗麻 / 针织 / 格子呢织物,靛蓝星空或深色叶丛里只有一处发光的点睛);白纸上不画背景、色调粉粉的角色小像仍用色粉小像,背后刷一块单色、大鼻子红脸蛋的复古童书大头像仍用复古水粉,满画面短排线、只有一个暖光的夜景小版画仍用排线夜景,粉彩黄昏转入星空的微缩风景仍用暮色微缩绘本,满画面彩铅叠涂的温暖黄昏童书页仍用暖调彩铅绘本。「油画棒 / 油画棒肖像 / 蜡笔干刷的人物 / 白纸上露着纸纹白点的粗笔触小像 / 橙黄配藏青」指油画棒肖像(浮在白色糙面纸上的人物小像:一道道平行干笔铺成的大块颜色里撒满纸纹白点,笔尾是硬的梳齿,藏红花黄、藏青、黑、一种冷蓝加橙色腮红和橙红嘴唇,黑色蜡笔只点在眼睛、眉毛和几处轮廓);同样白纸不画背景、但柔和粉粉、揉开的色粉小像仍用色粉小像,米白纸上几大块色加一块滚筒背景板的 mid-century 海报仍用干刷色块,小孩在糙纸上画的蜡笔画仍用儿童蜡笔画,梵高式厚涂的风景仍用油画厚涂。---# Claude 绘图@@ -91,6 +91,7 @@ description: Claude 绘图 / Claude Drawing —— 不借助任何生图模型| 彩色小镇 · Colour Town | `lib/colortown.py` · `ColorTown` | `examples/colortown_festival_steps.py` 雨后的节日台阶街 · Festival Steps After the Rain(1500×2000 的竖幅童话街景,不透明水粉平涂加细细的深棕墨线:节日的早晨,刚下过一阵雨,一条石头台阶从湿漉漉的小广场爬上山,从一栋薄荷绿房子底下的拱门里穿过去,接着往上走;番茄红、芥末黄、青绿、薄荷、珊瑚、奶白、天蓝的房子一排压一排堆上山坡,越往上越小、越淡,有尖尖的山墙、窄窄的塔楼式房子和几片赤陶瓦,深蓝灰的石板曼莎屋顶一片片错缝铺出来,带老虎窗、烟囱和赤陶烟囱帽、电视天线;山顶左边一座白色钟楼,铜绿洋葱顶、三扇木百叶钟楼开口、指着九点零几分的钟面、顶上一面红旗;淡蓝的天,奶白的云,几只小鸟;左边是一面往消失点收的峡谷墙(浅粉、白、浅黄三栋,整面墙按透视单应贴上去),右边是一栋离我们很近的白房子,有几扇浅蓝百叶窗、铁艺阳台、窗台花箱,底层是青绿色的咖啡馆,条纹遮阳篷,外面摆两张小咖啡桌;三角彩旗挂在四个深度上:远处山上两串很小的,上排房子前一串,广场上两串,最近四串大的斜穿过整个画面,每面旗有一道深一点的折痕,绳子从钟面下面过;红玫瑰和粉玫瑰爬满墙角,窗台花箱里花叶溢出来,还有花店 FLEURS 门口一排花桶、面包店 PAIN、吊挂的咖啡杯和钥匙店招、壁灯、墙脚的海报和盆栽、台阶两侧的石墙和铁栏杆、台阶上一只猫、两棵圆圆的绿树;广场是湿的,把房子、彩旗和人倒映成一道道竖向的笔触,石板缝淡淡地透出来;几个很小、不画脸的人:打红伞的、牵红气球的孩子、一对并肩走的、提一篮花的;照插画师的顺序画:空纸 → 天空和云 → 远处的小镇和钟楼 → 上面两排房子和树 → 拱门房子、台阶和广场边的房子 → 两侧的峡谷墙 → 玫瑰、花盆和店招 → 近处的彩旗 → 湿广场和倒影 → 行人、路灯和咖啡桌;`--stages` 出 9 个阶段加成品) | 约 7 秒 || 色粉小像 · Pastel Vignette | `lib/pastelvignette.py` · `PastelVignette` | `examples/pastelvignette_marmalade_scarf.py` 橘猫围巾 · The Marmalade Scarf(1920×1080 的白底角色小像,软色粉加一点水粉:冷天的早上,一个年轻女人把她的大橘猫当围巾围在脖子上——猫头和两只前爪从她一边肩上垂下来,一只后爪和带深色环纹的尾巴从另一边垂在大衣前面;她朝猫歪着头、斜眼看它、抿着嘴笑,猫用一双圆圆的琥珀色眼睛抬头看她;蓝黑色的长波浪发,侧分的刘海斜过额头,大圆眼、深棕虹膜和白高光,两大圈腮红,红鼻尖,小嘴;浅粉蓝的大衣看得见顺着衣褶和袖子的干笔,大衣下摆在白纸上干笔散开,里面是奶油色的罗纹毛衣;猫毛先铺一层宽的软笔触,再一簇簇细毛、受光处的浅色毛尖、额头几道深色虎纹,轮廓蓬松地融进后面的头发和大衣,奶白的嘴套和爪子、粉色的耳朵里、白胡子;背后左边一枝桉树叶(夹几片赭黄的),右边一层很淡的铅笔小镇(几栋房子和一座圆顶塔),其余都是白纸;照色粉插画师的顺序画:空纸 → 铅笔起稿 → 桉树枝和铅笔小镇 → 平涂大块 → 塑形(揉开的脸、大衣的干笔)→ 猫毛 → 一绺绺的头发 → 五官 → 干笔高光和飞出来的几根头发;`--stages` 出 8 个阶段加成品) | 约 9 秒 || 诗意万圣夜 · Poetic Halloween | `lib/poetichalloween.py` · `PoeticHalloween` | `examples/poetichalloween_ghost_jar.py` 罐子里的小幽灵 · The Ghost in the Jar(1920×1080 的秋夜绘本肖像,暗色画板上的水粉加细排线:十月的最后一夜,一个苍白的孩子站在深色的树丛里,戴一顶软塌的粗麻钟形帽(帽檐垂着松开的麻线,一圈麻绳打了个小蝴蝶结),乌黑的齐耳波波头、刀切一样平的齐刘海,整块头发上一道柔和的光泽;瓷白的脸,眼睛一圈、鼻梁和脸颊泛着红晕(平滑的红加细密的红斑点),厚眼皮半闭、往外眼角垂,低头看着手里的罐子,虹膜里映着一点暖光,红鼻尖,不笑的小嘴;深红的粗针织围巾围到下巴,一头垂在胸前,深色格子呢外套(藏青、墨绿加细的锈红和赭黄线,斜纹织出来,格子随衣褶起伏),两颗牛角扣;一双深红针织手套从两边扶着一个玻璃罐,罐口蒙着粗麻布、用麻绳扎住,罐子里一个床单小幽灵发着光,暖光照亮手套、玻璃边和她的下巴;树丛里和星空中还有五个小幽灵(银色细丝的身子,琥珀色发光的眼睛,衣摆每个尖一颗光珠),身边的叶子被照成橄榄色和橙色,其余的叶子几乎是黑绿的,每片都往后面投一块影子;靛蓝夜空里有细的斜笔触和星星;照在暗色画板上作画的顺序画:画板 → 粉笔起稿 → 夜空和星星 → 深色叶丛 → 平涂大块 → 极简的体积 → 织物 → 五官 → 小幽灵和它们的暖光 → 前景叶子和最后几笔;`--stages` 出 9 个阶段加成品) | 约 10 秒 |+| 油画棒肖像 · Oil-Pastel Portrait | `lib/oilpastel.py` · `OilPastel` | `examples/oilpastel_warm_cup.py` 捧着一杯热的 · Something Warm to Hold(1600×1600 的白纸人物小像,油画棒干刷:冬天早上的露天市集,一个年轻女人把黑头发松松地挽成一个髻,双手捧着一个纸杯举到胸前,低头看着它,热气从杯口卷上来、飘过她的脸边;脸颊、鼻尖和耳朵冻得发红(两块排线的橙色腮红、一点橙红的鼻尖),平涂的橙红嘴唇,压低的厚眼皮下一对黑眼睛;藏红花黄的粗针织围巾在脖子上绕两圈、围到下巴,一头垂在胸前,上面是一段段藏青的短色条,末端一排流苏;藏青大衣用一道道长的平行干笔铺满,满是顺着笔拉长的纸纹白点,下摆一道道收成长短不一的梳齿;冷蓝的露指针织手套,一只手的四根手指绕在牛皮纸杯套前面,另一只手的拇指搭在上面,黑色塑料杯盖;没有背景,人浮在白纸上;照油画棒画家的顺序画:白纸 → 大衣和袖子 → 围巾 → 头发 → 肤色(背光一侧的桃色、脖子、耳朵、手指)→ 杯子和手套 → 条纹和罗纹 → 黑色蜡笔的点睛 → 五官 → 热气和最后几笔飞出来的头发;`--stages` 出 9 个阶段加成品) | 约 6 秒 |各画风共用 `lib/core.py` 里的底层工具:噪声、模糊、样条曲线、多边形遮罩、有机轮廓 `blob_pts`、毛笔 `bristle_stroke`、中文字体查找;新四种还用到补零平移 `shift`、文字遮罩 `text_mask`、西文字体查找 `latin_font`/`load_font`,以及高度图打光 `height_normals`、`height_shadow`(沿光线步进的投影)、`ambient_occlusion`。@@ -171,7 +172,8 @@ description: Claude 绘图 / Claude Drawing —— 不借助任何生图模型- 温暖、怀旧、像翻开一本童书的一页:一只大而温柔的生物陪着一个小小的孩子(巨龟、大熊、温柔的怪兽陪孩子过河、等车、看日落),午后和黄昏的暖光、亮灯的窗和灯笼、草地、小溪和小镇,要满画面看得见彩色铅笔的笔触和纸齿,讲解片里「温柔的陪伴 / 慢慢来 / 一起走一段」的页,童书封面和插页 → 暖调彩铅绘本(要明亮可爱的彩铅甜品小物用韩国彩铅;要软蓝限色、乱线墨线的绘本跨页用蓝调绘本;要粉彩黄昏转入星空、满坡野花用暮色微缩绘本;要黑白石墨写生用铅笔素描;要不透明水粉的特写大头像用复古水粉);- 治愈、明亮、「细节多到看不完」的童话街景:一座彩色的欧洲小镇、节日的街道、雨后的广场、钟楼和台阶,满街彩旗、玫瑰、花箱和阳台,要一眼就是「手画的水粉插画加细细的描线」,竖幅海报、小红书封面、旅行 / 城市 / 节日 / 「理想的生活」的配图,讲解片里「一个地方 / 一个社区 / 很多人一起生活」的页 → 彩色小镇(要中式园林、古镇和春水用江南园林;要锡釉蓝砖上的运河小镇用代尔夫特蓝瓷砖;要彩纸剪出来的小镇用剪纸拼贴;要系统的微缩模型用等轴 2.5D;要针管笔速写加淡彩的小卡用钢笔淡彩;要没有描线的几何色块用扁平矢量;要彩铅叠涂的黄昏小镇用暖调彩铅绘本);- 一两个讨喜的角色的小像:一个人和他的小动物(猫、狗、狐狸)、温柔的一刻(抱着、依偎、对视)、人设卡和头像,要一眼就是「绘本里的色粉加一点水粉」——白纸上不画背景,画到边上就干笔散开,大圆眼、大腮红、红鼻尖,一根根的发丝和蓬松的毛,柔和的粉彩色里只有一种暖橙,讲解片里「这个人 / 这只宠物 / 陪伴」的页,小红书头像和封面 → 色粉小像(要复古童书味、背后刷一块单色、看得见毛衣针脚的大头像用复古水粉;要满画面彩铅叠涂、有天空有场景的黄昏绘本页用暖调彩铅绘本;要软蓝限色、乱线墨线的绘本跨页用蓝调绘本;要针管笔线稿加淡彩的速写小卡用钢笔淡彩;要明亮可爱的彩铅甜品小物用韩国彩铅);-- 秋天和万圣节的夜晚、忧郁又有点超现实的一刻:一个苍白的孩子或年轻人独自站在夜里,手里捧着一点光或一个发光的小东西,身边有几个发光的小幽灵,要一眼就是「诗意的万圣节绘本」——瓷白的脸上一圈红晕、半闭的厚眼皮、刀切的黑色波波头,摸得着的粗麻帽子、粗针织围巾、格子呢外套,暗沉的靛蓝夜空和深色叶丛里只有一处暖光,讲解片里「孤独 / 守护 / 秋天 / 夜晚」的页,万圣节海报、头像和小红书封面 → 诗意万圣夜(要白纸上不画背景、粉粉的温柔角色小像用色粉小像;要背后刷一块单色、看得见毛衣针脚的复古童书大头像用复古水粉;要深蓝夜色里只有一个暖光、满画面短排线的小版画用排线夜景;要粉彩黄昏转入星空、满坡小野花的微缩风景用暮色微缩绘本;要满画面彩铅叠涂、温暖治愈的黄昏童书页用暖调彩铅绘本)。+- 秋天和万圣节的夜晚、忧郁又有点超现实的一刻:一个苍白的孩子或年轻人独自站在夜里,手里捧着一点光或一个发光的小东西,身边有几个发光的小幽灵,要一眼就是「诗意的万圣节绘本」——瓷白的脸上一圈红晕、半闭的厚眼皮、刀切的黑色波波头,摸得着的粗麻帽子、粗针织围巾、格子呢外套,暗沉的靛蓝夜空和深色叶丛里只有一处暖光,讲解片里「孤独 / 守护 / 秋天 / 夜晚」的页,万圣节海报、头像和小红书封面 → 诗意万圣夜(要白纸上不画背景、粉粉的温柔角色小像用色粉小像;要背后刷一块单色、看得见毛衣针脚的复古童书大头像用复古水粉;要深蓝夜色里只有一个暖光、满画面短排线的小版画用排线夜景;要粉彩黄昏转入星空、满坡小野花的微缩风景用暮色微缩绘本;要满画面彩铅叠涂、温暖治愈的黄昏童书页用暖调彩铅绘本);+- 一个人的小像或半身像(街上的路人、冬天捧着热饮的人、戴帽子的姑娘、「一个人在做一件小事」),人设卡、头像和小红书封面,要一眼就是「手画的油画棒 / 蜡笔干刷」——白纸上不画背景,颜色收得紧而浓(藏红花黄、藏青、黑、一种冷蓝,橙色腮红、橙红嘴唇),大块颜色用粗笔一道道铺满、露着纸纹白点,笔触收尾干而硬,黑色蜡笔只点在眼睛和几处轮廓,脸简化、略歪、有表情,讲解片里「这个人 / 用户画像 / 一个普通人的一刻」的页 → 油画棒肖像(要柔和粉粉、揉开的色粉加一个小动物用色粉小像;要米白纸上几大块色、背后一块滚筒色板的 mid-century 海报用干刷色块;要背后刷一块单色、看得见毛衣针脚的复古童书大头像用复古水粉;要小孩画的蜡笔画用儿童蜡笔画;要梵高式的厚涂漩涡用油画厚涂)。每种画风一幅范例作为质量基准(范例都不用禅意主题);水墨另加一幅「月印万川」(留白托月、水面倒影)。@@ -1351,6 +1353,25 @@ from core import spline, curve, blob_pts, fbm1d, blur, polygon_mask- 颜色用 `PAINTS` 里的名字(board chalk chalk_warm;night_deep night indigo dusk haze star warmstar;porcelain porcelain_light porcelain_shade porcelain_deep flush flush_light flush_deep rim lip lip_dark lid_line crease;eye_white eye_shade iris iris_light pupil;jet hair_black hair_dark hair hair_sheen hair_shine silver silver_light;burlap_dark burlap burlap_light burlap_hi burlap_rust oxblood_deep oxblood_dark oxblood oxblood_light oxblood_pale navy bottle tar rust ochre mustard;leaf_black leaf_deep leaf leaf_olive leaf_moss leaf_maroon leaf_rust leaf_orange;ghost_dark ghost ghost_light ghost_white glow glow_core glow_ring ember)或 '#rrggbb';色阶用 `RAMPS` 里的名字(night porcelain hair silver burlap oxblood leaf leaf_olive leaf_maroon leaf_rust ghost glow,都是暗 → 亮)或自己给一串颜色。- 范例的场景脚本先把所有形状的遮罩算好(`plan()`),再按从前往后的遮挡算出每块「看得见的部分」(手套和袖口 > 罐子和盖布 > 袖子 > 围巾 > 外套;帽子 > 刘海 > 远侧那片头发 > 脸 > 后面的头发),每一层只往自己看得见的部分上画;留着的画布大小的遮罩一赋值就转成 float16。+**油画棒肖像 `OilPastel`**:+- 思路:照画油画棒的顺序画一张白纸上的人物小像(白纸 → 大块颜色:大衣、围巾、头发 → 肤色 → 道具和手套 → 条纹 → 黑色蜡笔的点睛 → 五官 → 热气和飞出来的发丝),画到边上就停:没有背景色块、没有边框,下摆用笔触本身收成一道道干的梳齿。+ - 纸:白色冷压纸,直方图均衡过的纸纹 `T`(0–1 均匀分布),所以「蜡挂在纸纹高于 1 − 压力的地方」直接就是覆盖率;预先算好沿 8 个方向拖开的纸纹(存成 uint8,拖得比色粉长),每一笔按自己的方向取,漏掉的纸坑顺着笔拉成短的白道。空白纸上留着约 4 级的纸纹明暗(参考图 3.6–4.3 级),不是一张平的数码白。+ - 一笔:中心线在方向场里积分出来(方向按 mod π 处理),棒的宽度不变(`taper` 才让它往笔尾收窄,头发用),两侧略有摆动。几千笔一次画完:Pillow 把每一笔的每一段按序号画进 2 倍超采样的整数 id 图,numpy 查回这一段,算出沿笔位置和横向位置。棒用秃了的那一面分成几「道」:每道有自己的压力(顺着笔的深浅条纹)、自己的一点明暗(`mix` 还能让几道换成第二种颜色)和自己的终点——在最后 `dry` 那一截里一道一道断掉,所以笔尾是一把长短不一的硬梳齿,不是软的渐隐;起笔钝而饱满。蜡只落在压力够得着的纸纹上,阈值很陡(白点是脆的,不是一层软颗粒);纸上已经有蜡的地方吃得进更多蜡(第二层盖得住第一层),但光着的纸坑仍然光着。bincount 汇回像素;一批太大就按 y 分带(每带 `band_px` 个子像素)。+ - 混色:蜡近乎不透明:新 = 旧 + 覆盖 ×(目标 − 旧),目标 =(1 − opacity)× 旧 × 颜色 / 纸色 + opacity × 颜色;`smear` 让一笔按蜡量 `F` 把底下已有的蜡带进自己的颜色一点。+ - 边:一块颜色按遮罩裁切时,遮罩的软边按中尺度噪声加纸纹取阈值(`edge`),边像拖过去的蜡棒一样断开;`spill=(dx, dy)` 让笔触朝那个方向冲出形状,每一段边冲出去的距离各不相同(一张 26 px 尺度的噪声),下摆是参差的梳齿,不是一条尺子画的线。+ - 点睛:`crayon()` 是有点毛的黑色蜡笔线:路径抖一点,切成长短不一、互相搭接的几段(手抬起来又按下去),每段粗细、压力各不相同,偶尔断开、偶尔在旁边补一笔更细的。`blush()` 是一块参差椭圆里的平行排线;`dashes()` 沿路径排一段段短而粗的色条(针织条纹、罗纹、流苏);`smear()` 是干刷的投影或一抹天色;`wisp()` 是往上卷的一缕热气。+ - 五官:`eye()` 是黑色蜡笔的眼睛:压低的上眼皮(`lid`,往下看)和下眼皮之间的开口,开口里才看得见的大而黑的虹膜,留一小块纸白当高光,一道在外眼角加粗、挑出去的上眼皮重线,一道淡的桃色双眼皮和一道轻的下眼线;`brow()` 一笔粗的蜡笔加几根短毛;`lips()` 用短而密的笔铺出平涂的橙红嘴唇和一道深一点的唇缝;`hair()` 从一条发根线(或一块区域)出发、顺着方向场、带很大弯曲、往笔尾收尖的长笔触。+ - 收尾:`finish()` 只记参数、在 render 里加(每张阶段快照都和成品一致,要在画第一笔之前调用):蜡下面透出来的纸纹、蜡的边缘一点左上受光的厚度(浅色的蜡最弱)、很淡的颗粒、极轻的柔化。+- 构造:`OilPastel(W, H, seed, keep_stages=True, stages_dir=None)`(总像素不超过 4096²),先 `finish()` 再 `paper(tone, tooth, drag)`。坐标是整张画布的像素;给方向场传一个数就是角度(度,0 向右、90 向下),方向场数组是弧度,也可以直接传 f(x, y) → 度(只在用到的点上求值)。+- 遮罩:`poly(pts, smooth)`、`ellipse(cx, cy, rx, ry, rot)`、`blob(cx, cy, rx, ry, rough)`、`tube(path, w0, w1)`(`w0` 可以是一串沿路径的宽度)、`rect(x0, y0, x1, y1)`、`below(xs, ys, invert)` 返回画布大小的浮点遮罩;`spot(cx, cy, rx, ry, rot, solid)` 软的场;`soften(mask, sigma)` 只在形状附近模糊。+- 方向场:`flow(角度, 扰动, 尺度)`、`field(f(x, y) → 度)`、`radial(cx, cy, offset)`、`contour(mask, sigma, offset, fallback)`、`blend(f1, f2, w)`、`rotate()`。+- 笔触:`fill(region, field, colour, length, width, density, pressure, alpha, dry, streak, smear, opacity, mix, spill, edge, passes, clip, avoid, fade)` 用平行的干笔铺满一块(`region` 是落笔概率遮罩或 (x0, y0, x1, y1);`colour` 给颜料、一串颜料(随机取)、{颜料: 权重}、'canvas' 或 f(x, y) → (N, 3);`pressure` 越低白点越多;`dry` 笔尾断成梳齿的那一截;`streak` 道与道之间的深浅;`avoid` 要绕开的东西;默认分 3 遍);`lines(paths, colour, width, pressure, …)` 画给定的折线;`stroke(path, width, colour, …)` 一笔。+- 点睛:`crayon(path, width, colour, pressure, wobble, seg, gap, double)`;`blush(cx, cy, rx, ry, colour, angle, strength)`;`dashes(path, colour, spacing, length, width, angle, along)`(`angle=90` 横过路径,`along` 让色条往一边挂出去,流苏用);`smear(region, colour, angle, length, width)`;`wisp(x, y, height, sway, colour, width)`。+- 五官:`eye(cx, cy, w, h, look, lid, side, rot, lower, lash, iris, crease)`(`side` 是外眼角朝哪边,`look` 取 -1..1);`brow(path, width)`;`lips(cx, cy, w, h, smile, rot, side, parting)`(`side` 让唇峰偏向一边,四分之三侧脸用);`hair(region, flow, colours, n, length, width, bend, pressure, dry, taper, roots, clip)`。+- 收尾:`finish(tooth, relief, grain, soft)`;`render()`、`composite()`、`stage(name)`、`save(path, stages_dir)`;`save('x.jpg')` 默认 quality 88、4:4:4 色度。+- 颜色用 `PAINTS` 里的名字(paper white black charcoal warmgrey grey;navy_deep navy navy_light indigo cobalt cool_deep cool cool_light mist;saffron_deep saffron marigold yellow butter orange ochre;skin_pale peach_light peach peach_deep skin_tan skin_brown skin_deep blush blush_light vermilion lip lip_dark;olive moss kraft kraft_dark rust)或 '#rrggbb'。+- 范例的场景脚本先把所有形状的遮罩算好(`plan()`),再按从前往后的遮挡算出每块「看得见的部分」(手指 > 近处的手套 > 拇指 > 杯子和杯盖 > 远处的手套 > 两只袖子 > 围巾垂下的一头 > 两圈围巾 > 脸 > 耳朵 > 脖子 > 头发 > 大衣),每一层只往自己看得见的部分上画;大衣下摆和袖子用 `spill` 冲出去,同时 `avoid` 它们前面的东西(不然会冲进手套和杯子留出来的空里);遮罩一赋值就存成 uint8,算完遮挡就删掉后面用不到的整形状。+**顺序**:都是先远后近、先大后小,文字最后叠加。水墨的雾要画在它该吞没的东西之后;水彩的叶梗要先画,并且只画在叶子外面。## 三、毛病清单(都真实出现过)@@ -2614,6 +2635,27 @@ from core import spline, curve, blob_pts, fbm1d, blur, polygon_mask| 袖子在下角多出一圈发白的轮廓 | 袖子顶上那道亮只留在前臂(乘两块前臂附近的软斑) || 峰值内存 1.07 GB | 整张的 `wash()` 按行分带算;方向场传函数时只在用到的点上求值;`soften()` 只在形状附近模糊(场景里和库里的遮罩模糊都换成它);render 按行分带;印刷颗粒在 `ground()` 里先算好;光栅化每带 80 万子像素:0.71–0.81 GB,耗时也从 12.4 秒降到约 10 秒 |+**油画棒肖像**++| 问题 | 改法 |+|---|---|+| 第一版人太小;头发是一顶头盔,后面垂下一条黑飘带;脸上一层淡肤色在蜡的厚度下像石膏 | 正方形画布里画半身像,脸放大(脸的局部单位到画布的比例 0.92 → 1.25);头发不再从耳后垂到脖子;脸不铺底色,就是纸,只在背光一侧和下巴下面放桃色;蜡的厚度按颜色深浅减弱(浅色最弱),幅度 ±7% → ±5%,模糊 1.1 → 1.5 |+| 手套像两块半透明的浅蓝玻璃,里面透出大衣的笔触,杯口也有藏青的道子 | 大衣用 `spill` 往下冲出下摆时是把遮罩整体往下平移,连手套和杯子留出来的「洞」的上沿也一起冲了进去:大衣的铺色加 `avoid`(它前面所有东西的并集) |+| 压力加到 1.0 还有两成白,第二层盖不住第一层 | 笔尾变干原来不管 `dry` 都在最后 22% 降压,改成按 `dry` 缩放(`dry=0` 就不干);同一批里上面那笔说了算,它的软边和干尾会把下面那笔挖白,所以 `fill()` 默认分 3 遍,两侧降压 0.2 → 0.12;纸上已有蜡的地方吃蜡系数 0.3 → 0.55。同一块实测:白 23% → 6–15%(看 `dry` 和 `streak`) |+| 大衣满是雪花:白点太多、太大 | 纸纹里 9 px 尺度那层的权重 0.3 → 0.18;块身的压力 0.84 → 0.96–0.97,只在下摆另铺一层更干的(0.88、`dry` 0.42)冲出去 |+| 眼睛是两个小黑块,直勾勾地瞪着人 | 重写 `eye()`:上眼皮按 `lid` 压下来,虹膜放大到眼宽的 0.42、只画在开口里,外眼角加粗挑出;往下看靠压低的眼皮,不靠挪虹膜 |+| 眉毛像钢笔线:细、光、两头尖 | `brow()` 收尖 0.55 → 0.4,两侧降压 0.45,宽 13 → 17–19 px |+| 头发像一顶贝雷帽:前额一道横的硬边,笔触横着往右扫,左边鼓出脸外一大块 | 头发外轮廓在远侧贴着额头;方向场瞄准发髻左上方一点(不是发髻本身),前额的笔触先往上再往后;底色密度 2.4 → 1.8,再从发际线出发画 70 笔收尖的长发丝,裁到稍微放大过的头发遮罩里(轮廓参差但不炸开);太阳穴垂一绺 |+| 手指是一排白板条加黑线,像条形码 | 每根手指是带圆头的管子,先铺一层浅桃色,下沿压一道桃色,指尖一笔深桃色,黑线只画在手指下沿;手指搭在颜色深一点的牛皮纸杯套上 |+| 手套是两个浅蓝的椭圆 | 颜色加深(cool / cool_deep 各半),近处那只改成手背到手腕的楔形,加几行浅色短色条当针脚、外侧一道黑线、袖口罗纹 |+| 两圈围巾的两头像毛刷 | 方向场原来顺着轮廓转,到两头笔触变成横的、梳齿正对着外面:每圈改用一个固定的竖向方向场(-86° / -90° 加一点扰动) |+| 下摆停在一条尺子画的横线上 | `spill` 原来冲出去的地方一样长:改成每段边各冲各的距离(26 px 尺度的噪声),袖子也冲 |+| 脸的近侧一大片桃色(侧面、脖子、耳朵连成一块),耳朵上压着一根黑线 | 侧面的桃色只留贴着轮廓的一条、密度 1.4 → 1.0,加一条桃色的下颌线;围巾近侧往上提、贴着下颌,脖子只露一小块;耳朵上那绺头发截短到耳朵上方 |+| 杯子下面两道黑色竖条像两条腿 | 下摆那层不再混黑,只用藏青和深藏青 |+| 热气是一串断开的虚线 | `wisp()` 断口的概率 0.25 → 0.1,分段 40–110 → 70–160 px,线宽 8 → 15 |+| 大衣两侧下角多出一块方角(肘部) | 袖子遮罩乘上大衣遮罩;大衣轮廓的闭合样条在下角过冲,补几个点 |+| 峰值内存 0.99 GB | 场景里画布大小的遮罩从 float16 改存 uint8,算完遮挡只留看得见的部分和几个后面要用的整形状;光栅化每带 0.9M → 0.6M 子像素:0.76 GB,成品和改之前只差 p99 6 级 |+## 四、做成动画- 各画风都有 `stage(name)` 和 `save(path, stages_dir)`,按阶段依次淡入叠化,就是「一幅画被逐步画出来」。README 里的动图就是这样做的。@@ -2713,6 +2755,13 @@ from core import spline, curve, blob_pts, fbm1d, blur, polygon_mask- 调色板:暗底容易出色带,所以给暗色多留位置:第一帧是空的暗画板,只给 8 色;200 色从和它不同的像素里切(末帧 ×3、饱和色 ×3——琥珀色的光、红晕、深红毛线、锈色叶子,暗色 ×2——夜空、叶丛、头发、外套,暗的暖棕 ×4——粗麻帽子和盖布:面积小,不加的话它的棕色被叶子的橄榄绿抢走,帽子在动图里变成橄榄灰);再单独从暗像素里切 24 色;4 色强制(最深的头发、奶白的光芯、琥珀色的光、瓷白的脸);剩下 19 色只从末帧误差超过 12 级的像素里切;最后 1 色是纯品红,当「和上一帧相同」的透明占位色。- 固定 4×4 Bayer(约 ±2.4 级),末帧不加抖动、精确发送(差 0.5 级以上就重发)。和屏上已显示颜色差不到 5 级(叠化帧)或 3 级(关键帧)的像素沿用上一帧;整帧都没变的叠化帧不单独发,时长并到上一帧。- 结果:46 帧,14.75 秒,约 1.21 MB,按解码结果逐帧自检(和应显示的画面最大差 0),末帧误差中位数 1、p99 19,夜空看不出色带。+- 油画棒肖像的动图(脚本在 `workspace_projects/arte4/work/make_gif_oilpastel.py`):+ - 画是正方形(1600×1600):每个阶段缩成 405×405 放在 720×405 的正中,两边 157 / 158 px 用第一张(空白纸)从画自己的边上往外镜像出去(画的两边本来就是空白纸),没有接缝,补的边每帧都不变。+ - 阶段:白纸 → 大衣和袖子 → 围巾 → 头发 → 肤色(背光一侧的桃色、脖子、耳朵、手指)→ 杯子和手套 → 条纹、罗纹和流苏 → 黑色蜡笔的点睛 → 五官(腮红、眼睛、眉毛、鼻子、嘴唇)→ 成品(热气、太阳穴的一绺头发、发髻上飞出来的发丝)。每段 900 毫秒加 5 帧叠化,末帧停 2600 毫秒。+ - 叠化一片片铺上去,和色粉小像的做法一样。+ - 调色板:第一帧是空白纸,只给 12 色;228 色只从和它不同的像素里切(末帧 ×3、饱和色 ×3——藏红花黄的围巾、橙色腮红、橙红嘴唇、冷蓝手套、牛皮纸杯套,暗色 ×2——藏青大衣和黑头发,白点就落在它们上面);再留 15 色,其中 4 个是强制的(蜡笔黑、纸白、藏红花黄、唇红),另外 11 色只从末帧误差超过 14 级的像素里切;最后 1 色是纯品红,当「和上一帧相同」的透明占位色。+ - 固定 4×4 Bayer(约 ±2.4 级),末帧不加抖动、精确发送(差 0.5 级以上就重发)。和屏上已显示颜色差不到 5 级(叠化帧)或 3 级(关键帧)的像素沿用上一帧;整帧都没变的叠化帧不单独发,时长并到上一帧。+ - 结果:42 帧,14.75 秒,约 0.43 MB,按解码结果逐帧自检(和应显示的画面最大差 0),末帧误差中位数 0、p99 12。画只占中间 405 px、四周又是白纸,所以小。- 绘本角色动画的动图是真动画,不是阶段叠化:`Storybook.gif()` 按时间逐帧渲染,720×405、15 fps(GIF 延时只能写厘秒,按累计取整写成 7、7、6 厘秒交替),共用一张加权调色板 + 固定 4×4 Bayer,没变的像素记成品红透明,151 帧(动作 9.95 秒 + 末帧停 1.4 秒)约 0.56 MB;范例加 `--gif out.gif` 出这张,`--stages` 的关键帧仍可喂给上面的阶段动图工具。- 形变动画可以直接出真动画:`Morph.at(keys, T)` 给出全局时间 T 的轮廓,逐帧渲染即可。- 更细的逐笔动画:把一组笔画单独画到透明层上导出,再用 Motion Canvas 遮罩按顺序显现。这个还没做成现成接口。@@ -2798,6 +2847,7 @@ lib/pencilbook.py 暖调彩铅绘本(以 1 px 细颗粒为主的直方图lib/colortown.py 彩色小镇(id 图光栅化的不透明色块:Pillow 按序号填多边形、2 倍超采样,numpy 查颜色 / 不透明度 / 纹理权重表、box 平均回像素;整张预算的竖向、横向笔刷条纹和擦笔纹理加低频斑驳,按块取权重,浅色少一点;边缘重采样后沿法线抖动;深棕半透明墨线:3 倍 id 图、带圆角接头的折线,分段变粗细,方框四边分开画、转角偶尔出头,按底色乘出深红棕或近黑;远近雾化与细线;把平摊布局贴到四边形上的透视单应;联排房子生成器:灰泥墙、裸石斑块、腰线、檐口、墙脚罩染和檐下阴影,门、带字招牌和条纹遮阳篷的店面、拱门,每扇略不同的窗(窗框、带反光的玻璃、窗棂、窗台、带横条的百叶窗、窗帘、圆窗和拱窗),溢出来的窗台花箱,铁艺阳台和花盆;一片片错缝铺、裁切、描缝的石板和赤陶瓦,曼莎、四坡、侧山墙、尖山墙,老虎窗、烟囱和烟囱帽、电视天线、风向标;带隅石、钟面、木百叶钟楼开口、洋葱顶、灯笼亭、尖顶和旗的钟楼;越往上越小的台阶、石墙、铁栏杆;杯形花瓣的爬藤玫瑰,按穹顶打光的叶簇树冠,花盆;抛物线下垂、带折痕的三角彩旗串;路灯和壁灯、吊挂店招、海报、咖啡桌、猫、不画脸的小人(伞、气球、花篮);透视石板、逐列镜像并竖向拖尾的湿街倒影、重描的石板缝和反光,把之后画的东西也倒映下来的 mirror;轻微柔化、细颗粒、暖色、淡暗角)lib/pastelvignette.py 色粉小像(直方图均衡的白纸纸纹与存成 uint8、沿 8 个方向拖开的纸纹,颜料缓冲;按段编号的 id 图光栅化:Pillow 把每一笔的每一段按序号画进 2 倍超采样的整数 id 图,numpy 查回这一段,算出沿笔压力曲线(两头收圆)、两侧软边和越干越开的鬃毛条纹,色粉只挂在压力够得着的纸纹上,bincount 汇回像素,大批按 y 分带;近乎不透明的色粉混色;揉开的平滑色层(按场取色、纸坑留浅、边缘按纸纹断开)和按软穹顶光取色阶的塑形;干边与不长孤岛的游走边、按渐隐场逐像素减压变干的散开;漂移、函数、放射、等值线(只在形状附近算)方向场与双倍角混合;按流向场积分、成绺(共用起点、偏移、弯曲和明暗)、暗先亮后的发丝和飞丝;根散尖聚、背光侧暗的毛簇;从轮廓里侧取色往外长的蓬松边;带灰蓝眼皮影、放射纹虹膜、外眼角挑出眼线和双高光的大圆眼,色粉带加细毛的眉毛,粉状大腮红,鼻梁软影加红鼻尖,小嘴;平滑的细圆笔线、几笔叠成的淡铅笔线;受光一侧浅、带浅色叶脉的叶子和带叶的枝条;轻微柔化、细颗粒、只上在颜色上的一点暖色)lib/poetichalloween.py 诗意万圣夜(直方图均衡的暗色画板纸纹与存成 uint8、沿 8 个方向拖开的纸纹,单像素细点子纹,颜料缓冲;和色粉小像同一套按段编号的 id 图光栅化,按 y 分带;取画布颜色「再画一遍」的笔触,以白为参照的乘法混色;按行分带的平滑色层和按软穹顶光取色阶的塑形,只在形状附近做的模糊;整块头发的窄带光泽和顺发流拉开的淡笔触、成绺的低对比发丝;重眼皮杏仁眼(眼皮盖住半个虹膜、外眼角下垂、湿红的下眼睑、虹膜里映出的暖光),平滑加单像素斑点的红晕和软斑、软环场,自成体积的长鼻子和红鼻尖,不笑的小嘴;粗麻平纹(各自粗细、有疙瘩、游走、一上一下交织的线,高度场打光,黑孔、纤维、毛边,可顺弧线织)、粗针织 V 形针脚与罗纹、镜像 sett 的 2/2 斜纹格子呢、从轮廓长出的纤维、顺管子弯的坐标;宽裂片重锯齿的掌状叶(压扁、对折、叶脉、投影)和从后往前的叶丛;陡衰减的暖色点光源、按接受度照亮已画好的东西、发光缓冲;银色细丝的半透明床单小幽灵(发光的眼睛、每绺末端的光珠);星星;柔化、三档光晕、印刷颗粒和暗部更显的粗纸纹、提亮的黑,按行分带算)+lib/oilpastel.py 油画棒肖像(直方图均衡的白纸纸纹、沿 8 个方向拖得更长的纸纹(uint8);和色粉小像同一套按段编号的 id 图光栅化,按 y 分带;宽度不变的棒:钝而饱满的起笔、略摆的两侧,分道的磨损面(每道自己的压力、明暗、第二色和终点:一道道断掉的硬梳齿笔尾),陡阈值的纸纹露白,已有蜡的地方吃蜡更多;近乎不透明的蜡混色和带底色的拖色;按噪声加纸纹断开的裁边、每段边冲出距离各不相同的 spill;平行干笔铺色、给定路径的干笔;抖动、分段搭接、粗细不一、偶尔断开和补笔的黑色蜡笔线;排线腮红、短色条、干刷投影、热气;压低眼皮的黑眼睛、粗眉、平涂嘴唇、收尖的长发丝;渲染时透出的纸纹、按颜色深浅减弱的蜡厚度、颗粒和极轻的柔化)examples/*.py 范例脚本;*.jpg 成品;drawing_*.gif 逐步画出的动图中文字体:自动找 Kaiti/Songti(macOS)、Noto CJK(Linux)、KaiTi/SimSun(Windows),或设 INKPAINT_FONT西文字体(后来新增的画风用):core.latin_font(style) 按 sans / sans_bold / rounded / script / hand / typewriter 等找系统字体,可用 INKPAINT_FONT_<STYLE> 指定;字体文件不要放进仓库diff --git a/examples/drawing_oilpastel_warm_cup.gif b/examples/drawing_oilpastel_warm_cup.gifnew file mode 100644index 0000000..e621f34Binary files /dev/null and b/examples/drawing_oilpastel_warm_cup.gif differdiff --git a/examples/oilpastel_warm_cup.jpg b/examples/oilpastel_warm_cup.jpgnew file mode 100644index 0000000..e5fbb99Binary files /dev/null and b/examples/oilpastel_warm_cup.jpg differdiff --git a/examples/oilpastel_warm_cup.py b/examples/oilpastel_warm_cup.pynew file mode 100644index 0000000..bdd646f--- /dev/null+++ b/examples/oilpastel_warm_cup.py@@ -0,0 +1,436 @@+"""Example (oil-pastel portrait): 捧着一杯热的 · Something Warm to Hold -- a winter-morning portrait in oil pastel.++A cold morning at an outdoor market. A young woman with her black hair pulled back into a loose bun holds a paper+cup up in both hands and looks down into it; the steam curls up past her face. Her cheeks, the tip of her nose and+her ear are red with the cold. A chunky saffron scarf, striped in navy, is wound twice round her neck up to the+chin, one end hanging in front; a navy wool coat; cool-blue fingerless gloves, the bare fingers of one hand wrapped+round the kraft sleeve of the cup, the thumb of the other on top; a black plastic lid. She floats on white paper as+a vignette: the coat runs out in dry streaks below, there is no background.++Drawn in the order an illustrator works with oil pastels: white paper -> the navy coat and sleeves laid in with+long parallel dry strokes -> the saffron scarf -> the black hair -> the skin (peach on the shadow side, the neck,+the ear, the fingers) -> the cup and the gloves -> the stripes and ribs as short bold dashes -> the black crayon+accents -> the face (eyes, brows, nose, blush, lips) -> steam and the last flyaway strokes. --stages writes those+steps as snapshots for the draw-on. No image model.+python3 oilpastel_warm_cup.py [out.jpg] [--stages DIR]+"""+import os, sys, time+sys.path.insert(0, os.path.join(os.path.dirname(os.path.abspath(__file__)), '..', 'lib'))+import numpy as np+from oilpastel import OilPastel++W, H = 1600, 1600+HC = np.array([800.0, 512.0]) # centre of her face (between the eyes)+S = 1.25 # face-local units -> canvas px+TILT = np.deg2rad(-5.0) # head leaning a little toward the cup+CS, SN = np.cos(TILT), np.sin(TILT)+CUP = dict(cx=660.0, top=1088.0, bot=1392.0, wt=112.0, wb=88.0) # half-widths at the rim and the base+KRAFT = (1180.0, 1320.0)+FINGERS = ((1198, 690), (1233, 676), (1268, 682), (1302, 698)) # (y, x of the tip) of the near hand's fingers+++def F(u, v):+ """face-local (u right, v down, before the tilt) -> canvas"""+ u, v = u * S, v * S+ return (HC[0] + u * CS - v * SN, HC[1] + u * SN + v * CS)+++def FL(pts):+ return [F(u, v) for u, v in pts]+++def cup_x(y, side):+ """the cup's silhouette: x of its left (side=-1) or right (+1) edge at height y"""+ c = CUP+ t = np.clip((y - c['top']) / (c['bot'] - c['top']), 0, 1)+ return c['cx'] + side * (c['wt'] + (c['wb'] - c['wt']) * t)+++class Scene:+ def __init__(self, p):+ self.p = p+ self.plan()++ def __setattr__(self, k, v):+ # the canvas-sized masks are kept as uint8 (0..255): plenty for coverage, a quarter of the memory+ if isinstance(v, np.ndarray) and v.dtype != np.uint8 and v.ndim == 2 and v.shape == (H, W):+ v = np.round(np.clip(v, 0, 1) * 255).astype(np.uint8)+ object.__setattr__(self, k, v)++ def m(self, name):+ return getattr(self, name).astype(np.float32) * np.float32(1 / 255)++ # ------------------------------------------------------------------ shapes+ def plan(self):+ p = self.p+ # head: face, ear, neck, hair, bun+ self.face = p.poly(FL([(-104, -100), (-110, -48), (-100, -10), (-107, 36), (-101, 86), (-84, 140), (-52, 186),+ (-12, 208), (36, 198), (86, 166), (126, 116), (148, 58), (152, 0), (146, -62),+ (124, -122), (60, -164), (-30, -170), (-88, -146)]), smooth=True)+ self.ear = p.poly(FL([(150, -10), (172, -26), (194, -10), (198, 30), (188, 64), (166, 74), (154, 54)]),+ smooth=True)+ self.neck = p.poly(FL([(60, 150), (150, 56), (200, 70), (212, 236), (40, 246)]))+ hair = p.poly(FL([(-104, -92), (-114, -140), (-94, -200), (-40, -242), (40, -262), (140, -242), (210, -186),+ (244, -110), (252, -30), (246, 50), (230, 118), (204, 146), (198, 80), (200, 20),+ (190, -36), (150, -72), (120, -124), (60, -150), (-30, -156), (-88, -136)]), smooth=True)+ self.bun_c = F(192, -242)+ self.bun = p.blob(self.bun_c[0], self.bun_c[1], 62 * S, 54 * S, 0.12, seed=4)+ self.hair = np.clip(hair + self.m('bun'), 0, 1)+ # scarf: two rolls round the neck, one end hanging in front+ self.r1 = p.poly([(560, 800), (620, 760), (700, 772), (790, 780), (870, 762), (940, 728), (1010, 708),+ (1084, 716), (1132, 776), (1112, 874), (1010, 908), (880, 922), (760, 918), (640, 900),+ (575, 866)], smooth=True)+ self.r2 = p.poly([(530, 898), (620, 890), (760, 916), (900, 918), (1030, 898), (1150, 906), (1180, 962),+ (1120, 1016), (940, 1032), (770, 1026), (630, 1008), (540, 964)], smooth=True)+ self.end_path = [(1010, 924), (1030, 1040), (1044, 1160), (1052, 1270)]+ self.end = p.tube(self.end_path, [140, 138, 134, 130])+ # coat and sleeves+ self.coat = p.poly([(290, 1466), (254, 1440), (258, 1340), (272, 1190), (304, 1090), (372, 1022), (500, 978),+ (640, 960), (900, 960), (1090, 972), (1228, 1012), (1314, 1080), (1346, 1200),+ (1356, 1360), (1360, 1440), (1330, 1466), (800, 1470)], smooth=True)+ self.sl_far_path = [(350, 1450), (410, 1416), (476, 1376), (540, 1346)]+ self.sl_far = p.tube(self.sl_far_path, [168, 160, 152, 144]) * self.m('coat')+ self.sl_near_path = [(1290, 1450), (1170, 1424), (1040, 1390), (904, 1360)]+ self.sl_near = p.tube(self.sl_near_path, [194, 188, 178, 166]) * self.m('coat')+ # cup, lid, kraft sleeve+ c = CUP+ ys = np.linspace(c['top'], c['bot'], 12)+ self.cup = p.poly([(cup_x(y, -1), y) for y in ys] + [(cup_x(y, 1), y) for y in ys[::-1]])+ self.lid = p.poly([(c['cx'] - c['wt'] - 10, c['top'] + 6), (c['cx'] - c['wt'] + 2, c['top'] - 26),+ (c['cx'] + c['wt'] - 2, c['top'] - 26), (c['cx'] + c['wt'] + 10, c['top'] + 6),+ (c['cx'] + c['wt'] + 8, c['top'] + 20), (c['cx'] - c['wt'] - 8, c['top'] + 20)])+ y0, y1 = KRAFT+ self.kraft = p.poly([(cup_x(y0, -1) - 3, y0), (cup_x(y0, 1) + 3, y0), (cup_x(y1, 1) + 3, y1),+ (cup_x(y1, -1) - 3, y1)])+ # hands: the near glove on the right of the cup, four bare fingers across its front; the far glove on the+ # left, its thumb across the front above the fingers+ self.glove_n = p.poly([(782, 1178), (812, 1170), (850, 1182), (886, 1226), (912, 1290), (922, 1350),+ (902, 1388), (852, 1392), (814, 1356), (788, 1306)], smooth=True)+ self.finger_paths, fing = [], []+ for y, tip in FINGERS:+ path = [(800, y + 3), (740, y), (tip, y + 3)]+ self.finger_paths.append(path)+ fing.append(p.tube(path, [33, 32, 29]) + p.ellipse(tip + 2, y + 3, 14.5, 14.5))+ self.fing_each = [np.round(np.clip(f, 0, 1) * 255).astype(np.uint8) for f in fing]+ self.fingers = np.clip(sum(fing), 0, 1)+ self.glove_f = p.poly([(524, 1176), (566, 1156), (598, 1166), (604, 1246), (594, 1316), (566, 1356),+ (530, 1352), (512, 1290), (510, 1226)], smooth=True)+ self.thumb_path = [(568, 1168), (612, 1156), (654, 1150)]+ self.thumb = np.clip(p.tube(self.thumb_path, [36, 32, 28]) + p.ellipse(656, 1151, 14, 14), 0, 1)+ # visible parts, front to back+ order = ['fingers', 'glove_n', 'thumb', 'cup', 'lid', 'glove_f', 'sl_near', 'sl_far', 'end', 'r1', 'r2',+ 'face', 'ear', 'neck', 'hair', 'coat']+ front = np.zeros((H, W), np.float32)+ for name in order:+ if name == 'coat': self.front_coat = front.copy()+ if name == 'sl_near': self.front_sleeves = front.copy()+ mm = self.m(name)+ setattr(self, name + '_v', np.clip(mm - front, 0, 1))+ front = np.clip(front + mm, 0, 1)+ del front+ # only the visible parts are needed from here on (and a few whole shapes for fields and boxes)+ for k in ('face', 'ear', 'neck', 'end', 'sl_far', 'sl_near', 'cup', 'glove_n', 'glove_f', 'thumb', 'fingers'):+ delattr(self, k)++ # ------------------------------------------------------------------ 1. the coat+ def coat_(self):+ p = self.p+ cv = self.m('coat_v')+ # long parallel strokes, a little slanted, running out in streaks at the bottom+ fc = self.m('front_coat')+ body = cv * p.soften(p.below(None, 1390, invert=True), 30)+ p.fill(body, p.flow(-96, 5, 300, seed=11), {'navy': 6, 'navy_deep': 2, 'black': 1}, length=(160, 320),+ width=(40, 62), density=3.0, pressure=0.97, dry=0.24, streak=0.3, edge=0.45, avoid=fc, seed=12)+ low = cv * p.soften(p.below(None, 1330), 30)+ p.fill(low, p.flow(-94, 5, 300, seed=18), {'navy': 5, 'navy_deep': 3}, length=(140, 260),+ width=(38, 58), density=2.4, pressure=0.88, dry=0.42, streak=0.45, spill=(0, 70), edge=0.6, avoid=fc,+ seed=19)+ # her near side, away from the light, and the lower coat: deeper navy and black+ shade = cv * p.spot(1250, 1260, 200, 360, solid=0.1)+ p.fill(shade, -95, {'navy_deep': 3, 'black': 1}, length=(130, 260), width=(34, 52), density=1.3,+ pressure=0.9, dry=0.4, avoid=fc, seed=13)+ # shoulders: strokes following the slope; the light catching the far shoulder+ sh = cv * p.soften(p.below(None, 1110, invert=True), 30)+ p.fill(sh, p.contour(self.m('coat'), 40, 0, -95), {'navy': 3, 'navy_light': 2}, length=(110, 220),+ width=(32, 46), density=1.3, pressure=0.86, dry=0.35, seed=14)+ p.fill(cv * p.spot(380, 1110, 130, 150, solid=0.2), -100, {'cobalt': 2, 'navy_light': 2}, length=(100, 200),+ width=(24, 36), density=1.0, pressure=0.78, dry=0.45, seed=15)+ # sleeves: along the forearm, lighter along the top+ for name, path, seed in (('sl_far_v', self.sl_far_path, 16), ('sl_near_v', self.sl_near_path, 17)):+ mm = self.m(name)+ a = np.rad2deg(np.arctan2(path[-1][1] - path[0][1], path[-1][0] - path[0][0]))+ p.fill(mm, a, {'navy': 5, 'navy_deep': 2}, length=(130, 240), width=(34, 50), density=3.0,+ pressure=0.96, dry=0.28, edge=0.4, spill=(0, 60), avoid=self.m('front_sleeves'), seed=seed)+ xs = [q[0] for q in path]; ys = [q[1] - 62 for q in path]+ o = np.argsort(xs)+ top = mm * p.soften(p.below(list(np.array(xs)[o]), list(np.array(ys)[o]), invert=True), 18)+ p.fill(top, a, {'navy_light': 2, 'cobalt': 1}, length=(90, 180), width=(20, 30), density=1.0,+ pressure=0.78, dry=0.45, seed=seed + 20)++ # ------------------------------------------------------------------ 2. the scarf+ def scarf(self):+ p = self.p+ for name, seed in (('r2', 21), ('r1', 22)):+ mm = self.m(name + '_v')+ fld = p.flow(-86 if name == 'r1' else -90, 7, 200, seed=seed + 40)+ p.fill(mm, fld, {'saffron': 5, 'marigold': 2, 'saffron_deep': 1}, length=(60, 130), width=(30, 44),+ density=3.0, pressure=0.93, dry=0.28, mix=('yellow', 0.1), edge=0.5, seed=seed)+ bb = p._bbox(self.m(name))+ # the top of each roll in the light, the underside in shadow+ top = mm * p.soften(p.below(None, bb[1] + 46, invert=True), 10)+ p.fill(top, fld, {'marigold': 2, 'yellow': 1}, length=(40, 80), width=(18, 26), density=1.2,+ pressure=0.8, dry=0.4, seed=seed + 3)+ under = mm * p.soften(p.below(None, bb[3] - 40), 10)+ p.fill(under, fld, {'saffron_deep': 2, 'orange': 1}, length=(40, 80), width=(20, 30), density=1.5,+ pressure=0.86, dry=0.35, seed=seed + 5)+ ev = self.m('end_v')+ p.fill(ev, -92, {'saffron': 5, 'marigold': 2, 'saffron_deep': 1}, length=(80, 160), width=(30, 42),+ density=3.0, pressure=0.93, dry=0.3, mix=('yellow', 0.1), edge=0.45, seed=23)+ p.fill(ev * p.soften(p.rect(1040, 900, 1140, 1300), 12), -92, {'saffron_deep': 2, 'orange': 1},+ length=(60, 130), width=(20, 30), density=1.2, pressure=0.84, dry=0.4, seed=24)+ # where the end comes out from under the rolls+ p.fill(ev * p.spot(1012, 935, 90, 40, solid=0.2), 0, {'saffron_deep': 1, 'orange': 1}, length=(40, 80),+ width=(14, 22), density=1.4, pressure=0.84, seed=25)++ # ------------------------------------------------------------------ 3. the hair+ def hair_(self):+ p = self.p+ hv = self.m('hair_v')+ bc = self.bun_c+ tx, ty = bc[0] - 70, bc[1] - 90 # swept up and back: aim a little above the bun+ fld = lambda x, y: np.rad2deg(np.arctan2(ty - y, tx - x))+ # an open base, swept back from the hairline toward the bun+ p.fill(hv * (1 - self.m('bun')), fld, {'black': 5, 'charcoal': 1, 'navy_deep': 1}, length=(110, 220),+ width=(18, 28), density=1.8, pressure=0.92, dry=0.45, streak=0.5, edge=0.85, seed=31)+ # the strands: long strokes from the hairline back to the bun, over the edge of the mass+ line = p.poly(FL([(-108, -100), (-92, -146), (-30, -164), (60, -158), (122, -128), (152, -76), (160, -40),+ (150, -60), (116, -116), (58, -146), (-30, -152), (-86, -134)]))+ hclip = p._edge_clip(np.clip(p.soften(self.m('hair'), 6) * 1.6, 0, 1), 0.8)+ p.hair(None, fld, ('black', 'black', 'charcoal'), 70, (160, 320), (9, 16), bend=0.035, pressure=0.92,+ roots=line, dry=0.45, taper=0.65, clip=hclip, seed=32)+ nape = p.poly(FL([(196, -40), (246, -40), (240, 110), (204, 130)]))+ p.hair(None, fld, ('black', 'charcoal'), 14, (100, 200), (9, 14), bend=0.03, pressure=0.88, roots=nape,+ taper=0.6, seed=33)+ # the bun: scribbled round and round+ bm = self.m('bun') * hv+ p.fill(bm, p.contour(self.m('bun'), 14, 0), {'black': 4, 'navy_deep': 1}, length=(70, 140), width=(16, 24),+ density=2.4, pressure=0.9, dry=0.4, edge=0.7, seed=34)+ r = np.random.default_rng(35)+ for i in range(5):+ t = np.linspace(0, 2 * np.pi * r.uniform(0.7, 1.1), 30) + r.uniform(0, 6.3)+ rr = (r.uniform(0.45, 0.95) * 62 * S)+ pts = [(bc[0] + rr * np.cos(a) * 1.1, bc[1] + rr * np.sin(a) * 0.92) for a in t]+ p.crayon(pts, r.uniform(7, 11), 'black', 0.9, wobble=2.0, seed=36 + i)+ # the light on the crown: a few navy strokes+ crown = hv * p.spot(*F(0, -200), 110 * S, 50 * S, solid=0.1)+ p.fill(crown, fld, 'navy_light', length=(90, 170), width=(6, 10), density=0.2, pressure=0.7, dry=0.5,+ seed=41)++ # ------------------------------------------------------------------ 4. skin+ def skin(self):+ p = self.p+ fv = self.m('face_v')+ # the face is the paper; peach only on the shadow side: the side plane from the temple to the jaw+ side = fv * p.soften(p.poly(FL([(104, -112), (148, -64), (152, 54), (128, 112), (92, 156), (100, 110),+ (120, 40), (118, -40)]), smooth=True), 10)+ p.fill(side, -68, {'peach': 2, 'peach_light': 3}, length=(50, 110), width=(12, 20), density=1.0,+ pressure=0.74, dry=0.45, seed=51)+ # under the chin and along the jaw, the far contour, the temple+ jaw = fv * p.soften(p.poly(FL([(-70, 150), (-30, 190), (40, 180), (100, 146), (112, 166), (40, 210),+ (-16, 216), (-64, 192)]), smooth=True), 6)+ p.fill(jaw, -12, {'peach': 2, 'peach_deep': 1}, length=(50, 100), width=(14, 22), density=1.7, pressure=0.84,+ dry=0.35, seed=52)+ p.crayon(FL([(-102, -70), (-106, -30), (-100, -6), (-106, 36), (-100, 84), (-86, 132), (-56, 178)]), 9,+ 'peach', 0.8, wobble=1.4, gap=0.15, seed=53)+ p.crayon(FL([(-56, 182), (-14, 204), (30, 196), (80, 170), (118, 126), (142, 70)]), 8, 'peach_deep', 0.82,+ gap=0.15, seed=54)+ # the eye sockets, the nose's shadow side and its underside+ p.fill(fv * p.spot(*F(52, -20), 56 * S, 24 * S, solid=0.2), -15, 'peach_light', length=(30, 70),+ width=(12, 18), density=1.4, pressure=0.68, dry=0.4, seed=55)+ p.fill(fv * p.spot(*F(-72, -16), 30 * S, 18 * S, solid=0.2), -15, 'peach_light', length=(20, 50),+ width=(10, 16), density=1.2, pressure=0.64, dry=0.4, seed=56)+ p.lines([FL([(-14, -8), (-12, 30), (-20, 62)])], 'peach', 15, 0.78, dry=0.4, seed=57)+ p.lines([FL([(-46, 88), (-26, 94), (-4, 86)])], 'peach', 11, 0.74, dry=0.3, seed=58)+ # the neck under the jaw, in shadow+ nv = self.m('neck_v')+ p.fill(nv, -100, {'peach_light': 2, 'peach': 2}, length=(60, 120), width=(16, 24), density=1.8,+ pressure=0.8, dry=0.4, edge=0.5, seed=59)+ p.fill(nv * p.soften(p.poly(FL([(60, 150), (150, 56), (170, 80), (90, 190)])), 8), -20, 'peach_deep',+ length=(40, 80), width=(12, 18), density=1.4, pressure=0.8, dry=0.4, seed=60)+ # the ear: red with cold+ ev = self.m('ear_v')+ p.fill(ev, -80, {'blush': 2, 'peach': 1}, length=(40, 80), width=(14, 20), density=2.6, pressure=0.88,+ edge=0.4, seed=50)+ # bare fingers and thumb: paper, peach along the underside and at the knuckle end+ for i, (path, fm) in enumerate(zip(self.finger_paths, self.fing_each)):+ fm = fm.astype(np.float32) * np.float32(1 / 255)+ p.fill(fm, 180, {'peach_light': 2, 'skin_pale': 1}, length=(50, 90), width=(14, 20), density=2.6,+ pressure=0.84, dry=0.3, clip=p._edge_clip(fm, 0.2), seed=61 + i)+ q = [(x, y + 9) for x, y in path]+ p.lines([q], {'peach': 2, 'peach_deep': 1}, 12, 0.88, dry=0.3, clip=fm, seed=65 + i)+ tip = path[-1]+ p.lines([[(tip[0] + 18, tip[1] - 4), (tip[0] - 4, tip[1] + 2), (tip[0] + 10, tip[1] + 12)]], 'peach_deep',+ 9, 0.8, dry=0.3, clip=fm, seed=69 + i)+ tv = self.m('thumb_v')+ p.fill(tv, -14, {'peach_light': 2, 'skin_pale': 1}, length=(50, 90), width=(14, 20), density=2.6,+ pressure=0.84, dry=0.3, clip=p._edge_clip(tv, 0.2), seed=73)+ p.lines([[(x, y + 9) for x, y in self.thumb_path]], 'peach', 12, 0.86, dry=0.3, clip=tv, seed=74)++ # ------------------------------------------------------------------ 5. cup and gloves+ def cup_(self):+ p = self.p+ c = CUP+ cv = self.m('cup_v')+ kr = self.m('kraft') * cv+ p.fill(kr, -2, {'kraft': 3, 'kraft_dark': 1}, length=(70, 140), width=(20, 30), density=3.0, pressure=0.92,+ dry=0.28, edge=0.3, seed=71)+ # the paper cup: white, a cool shadow down its right side, a warm-grey contour+ body = cv * (1 - self.m('kraft')) * (1 - self.m('lid'))+ shadow = body * p.soften(p.rect(c['cx'] + 40, c['top'], c['cx'] + 130, c['bot']), 16)+ p.fill(shadow, -92, {'mist': 2, 'cool_light': 1}, length=(50, 110), width=(16, 24), density=1.6,+ pressure=0.74, dry=0.35, seed=72)+ p.crayon([(cup_x(y, 1) - 2, y) for y in np.linspace(c['top'] + 22, c['bot'], 8)], 6, 'warmgrey', 0.82,+ clip=cv, seed=73)+ p.crayon([(cup_x(y, -1) + 2, y) for y in np.linspace(c['top'] + 22, KRAFT[0] - 20, 4)], 5, 'warmgrey', 0.7,+ clip=cv, seed=74)+ p.crayon([(cup_x(c['bot'] - 4, -1) + 8, c['bot'] - 6), (c['cx'], c['bot'] + 2),+ (cup_x(c['bot'] - 4, 1) - 6, c['bot'] - 6)], 6, 'warmgrey', 0.8, clip=cv, seed=75)+ # the lid+ lv = self.m('lid_v')+ p.fill(lv, 0, {'black': 3, 'charcoal': 1}, length=(60, 120), width=(16, 22), density=3.0, pressure=0.94,+ dry=0.2, edge=0.3, seed=76)+ p.lines([[(c['cx'] - c['wt'] + 16, c['top'] - 18), (c['cx'] + c['wt'] - 16, c['top'] - 18)]], 'grey', 5,+ 0.62, dry=0.3, seed=77)+ # gloves: cool blue knit, darker on their shadow side+ for name, seed, dark in (('glove_f_v', 78, (520, 1300)), ('glove_n_v', 79, (900, 1320))):+ gm = self.m(name)+ p.fill(gm, -70, {'cool': 2, 'cool_deep': 2}, length=(50, 100), width=(18, 26),+ density=3.2, pressure=0.97, dry=0.2, streak=0.3, edge=0.35, seed=seed)+ p.fill(gm * p.spot(dark[0], dark[1], 70, 80, solid=0.2), -78, {'cool_deep': 2, 'navy': 1},+ length=(40, 80), width=(14, 22), density=1.4, pressure=0.86, dry=0.35, seed=seed + 10)++ # ------------------------------------------------------------------ 6. stripes and ribs+ def stripes(self):+ p = self.p+ # navy stripes across each roll of the scarf+ p.dashes([(586, 846), (680, 836), (790, 848), (900, 842), (1010, 818), (1100, 818)], 'navy', 74,+ (70, 112), (20, 30), 90, jitter=11, clip=self.m('r1_v'), seed=81)+ p.dashes([(556, 952), (670, 954), (800, 970), (940, 970), (1080, 956), (1150, 950)], 'navy', 78,+ (60, 98), (20, 30), 90, jitter=11, clip=self.m('r2_v'), seed=82)+ # on the hanging end the stripes are bands across it+ for y in (1010, 1100, 1190):+ x = np.interp(y, [924, 1040, 1160, 1270], [1010, 1030, 1044, 1052])+ p.dashes([(x - 64, y), (x + 64, y + 2)], 'navy', 40, (48, 64), (22, 28), 0, jitter=4,+ clip=self.m('end_v'), seed=83 + int(y))+ # the fringe: short dashes hanging under the end+ p.dashes([(992, 1286), (1112, 1290)], {'saffron': 2, 'saffron_deep': 1}, 13, (34, 50), (8, 11), 90,+ jitter=9, along=0.45, seed=89)+ # ribbed cuffs on the gloves, the rolled edge where the fingers come out+ p.dashes([(808, 1370), (870, 1386), (930, 1356)], 'cool_deep', 14, (26, 34), (7, 9), 90, along=-0.2,+ clip=self.m('glove_n_v'), seed=90)+ p.dashes([(520, 1310), (556, 1346), (596, 1326)], 'cool_deep', 14, (26, 34), (7, 9), 90, along=-0.2,+ clip=self.m('glove_f_v'), seed=91)+ p.crayon([(792, 1180), (788, 1240), (792, 1300), (804, 1344)], 11, 'cool_light', 0.88,+ clip=self.m('glove_n_v'), seed=92)+ # knit rows over the backs of the gloves: short light dashes+ rows = (((800, 1214), (880, 1236)), ((806, 1254), (896, 1282)), ((814, 1296), (906, 1326)),+ ((526, 1206), (594, 1196)), ((524, 1246), (598, 1238)), ((528, 1286), (594, 1280)))+ for i, (a, b) in enumerate(rows):+ p.dashes([a, b], 'cool_light', 15, (14, 20), (6, 8), 70, jitter=10, pressure=0.8,+ clip=self.m('glove_n_v' if i < 3 else 'glove_f_v'), seed=93 + i)++ # ------------------------------------------------------------------ 7. black accents+ def accents(self):+ p = self.p+ # coat: the arms against the body, the folds of the sleeves, the shadow under the scarf+ p.crayon([(372, 1060), (340, 1180), (328, 1310), (334, 1400)], 9, seed=101)+ p.crayon([(1236, 1050), (1262, 1170), (1266, 1300)], 9, seed=102)+ p.crayon([(330, 1470), (420, 1420), (500, 1394)], 8, seed=103)+ p.crayon([(1236, 1376), (1120, 1344), (1010, 1316)], 8, pressure=0.86, seed=104)+ p.crayon([(1100, 1400), (1130, 1372)], 7, seed=105)+ p.crayon([(600, 1030), (740, 1044), (880, 1040)], 8, pressure=0.84, seed=106)+ # sleeve ends against the gloves+ p.crayon([(526, 1318), (548, 1364), (594, 1352)], 7, pressure=0.86, seed=107)+ p.crayon([(906, 1350), (878, 1392), (820, 1386)], 7, pressure=0.86, seed=108)+ # the gloves' outer contours+ p.crayon([(876, 1206), (906, 1262), (920, 1330)], 6, pressure=0.84, gap=0.2, seed=120)+ p.crayon([(530, 1172), (512, 1226), (514, 1300)], 6, pressure=0.84, gap=0.2, seed=121)+ # where one roll of the scarf tucks under the other+ p.crayon([(590, 892), (700, 906), (840, 918), (980, 908), (1080, 888)], 7, 'saffron_deep', 0.92, seed=109)+ # fingers: under each finger, and the gap above the first+ for i, path in enumerate(self.finger_paths):+ q = [(x, y + 15) for x, y in path[:2]] + [(path[2][0] + 6, path[2][1] + 13)]+ p.crayon(q, 5, 'black', 0.88, wobble=0.6, gap=0.2, seed=110 + i)+ p.crayon([(x, y - 15) for x, y in self.finger_paths[0][:2]] + [(FINGERS[0][1] + 10, FINGERS[0][0] - 10)], 4.5,+ 'black', 0.82, gap=0.3, seed=115)+ p.crayon([(x, y + 15) for x, y in self.thumb_path], 4.5, 'black', 0.82, seed=116)+ # the lid's rim+ c = CUP+ p.crayon([(c['cx'] - c['wt'] - 8, c['top'] + 18), (c['cx'], c['top'] + 22),+ (c['cx'] + c['wt'] + 8, c['top'] + 18)], 6, seed=117)+ # the ear's curl, the line of the jaw into the neck+ p.crayon(FL([(178, -12), (190, 14), (184, 46), (170, 60)]), 6, 'black', 0.86, seed=118)+ p.crayon(FL([(96, 160), (126, 118), (146, 64)]), 5, 'peach_deep', 0.8, seed=119)++ # ------------------------------------------------------------------ 8. the face+ def features(self):+ p = self.p+ # blush: the near cheek big, the far cheek smaller; the cold red tip of the nose+ p.blush(*F(58, 66), 48 * S, 34 * S, 'blush', -60, 0.92, seed=121)+ p.blush(*F(-88, 56), 20 * S, 30 * S, 'blush', -70, 0.85, clip=self.m('face_v'), seed=122)+ p.blush(*F(-36, 72), 14 * S, 10 * S, 'vermilion', -40, 0.6, seed=123)+ # eyes looking down into the cup, the far one narrower and a little higher+ p.eye(*F(44, 2), 72 * S, 33 * S, look=(-0.45, 0.7), lid=0.6, side=1, rot=-6, seed=124)+ p.eye(*F(-70, -2), 48 * S, 28 * S, look=(-0.55, 0.7), lid=0.6, side=-1, rot=-10, lash=0.3, seed=125)+ p.brow(FL([(6, -44), (44, -56), (86, -49)]), 19, seed=126)+ p.brow(FL([(-98, -41), (-76, -52), (-46, -50)]), 17, seed=127)+ # nose: the far contour, a nostril+ p.crayon(FL([(-30, 20), (-42, 50), (-52, 72), (-44, 84)]), 6, 'black', 0.9, seed=128)+ p.crayon(FL([(-26, 88), (-12, 86)]), 7, 'black', 0.92, seed=129)+ # lips: small, closed, a hint of a smile+ p.lips(*F(-26, 128), 70 * S, 28 * S, smile=0.25, rot=-6, side=-1, seed=130)++ # ------------------------------------------------------------------ 9. steam and last touches+ def last(self):+ p = self.p+ c = CUP+ for i, (x, h, sw, col) in enumerate(((618, 380, 26, 'cool_light'), (652, 470, 34, 'mist'),+ (592, 300, 20, 'cool_light'))):+ p.wisp(x, c['top'] - 40, h, sw, col, 15, 0.9, seed=131 + i)+ # loose hair: strands escaping at the far temple and over the ear, flyaways off the bun+ p.stroke(FL([(-40, -160), (-80, -130), (-104, -80), (-110, -20), (-100, 30)]), 11, 'black', pressure=0.92,+ dry=0.5, taper=0.75, seed=135)+ p.stroke(FL([(-20, -160), (-66, -128), (-88, -80), (-92, -36)]), 7, 'black', pressure=0.86, dry=0.5,+ taper=0.8, seed=136)+ p.stroke(FL([(132, -96), (152, -56), (160, -18)]), 7, 'black', pressure=0.88, dry=0.5, taper=0.75, seed=137)+ bc = self.bun_c+ p.hair(p.spot(bc[0], bc[1], 76, 66, solid=0.3), p.radial(bc[0], bc[1], 35), ('black', 'black', 'charcoal'),+ 9, (90, 170), (4, 7), bend=0.12, pressure=0.86, seed=138)+++PHASES = ('coat_', 'scarf', 'hair_', 'skin', 'cup_', 'stripes', 'accents', 'features', 'last')+++def main():+ out = sys.argv[1] if len(sys.argv) > 1 and not sys.argv[1].startswith('--') else 'oilpastel_warm_cup.jpg'+ stages = sys.argv[sys.argv.index('--stages') + 1] if '--stages' in sys.argv else None+ T0 = time.time()+ tick = (lambda name: print(f'{name:12s} {time.time() - T0:5.1f}s')) if os.environ.get('OP_TIMING') else (lambda n: None)+ p = OilPastel(W, H, seed=8, keep_stages=bool(stages), stages_dir=stages)+ p.finish()+ p.paper()+ p.stage('paper')+ sc = Scene(p)+ tick('setup')+ for name in PHASES[:-1]:+ getattr(sc, name)()+ tick(name)+ p.stage(name.strip('_'))+ getattr(sc, PHASES[-1])()+ tick(PHASES[-1])+ p.save(out, stages_dir=stages)+ print('saved', out, f'{time.time() - T0:.1f}s', p.n_strokes, 'strokes')+++if __name__ == '__main__':+ main()diff --git a/lib/oilpastel.py b/lib/oilpastel.pynew file mode 100644index 0000000..057bbbe--- /dev/null+++ b/lib/oilpastel.py@@ -0,0 +1,966 @@+"""oilpastel — 油画棒肖像 / Oil-Pastel Portrait: bold dry waxy strokes, textured colour, beautifully imperfect+portraits on white paper (numpy + Pillow only).++The look: a figure drawn with oil pastels (wax crayons) on white, toothy cold-press paper and left floating as a+vignette -- no background, at most a smear of sky or a dry-brushed black cast shadow. A tight, high-chroma palette:+saffron / marigold, navy (a teal navy) and black, one cool blue, orange blush and red-orange lips. Big flat masses+(a sweater, a hat, a coat, a scarf) are laid in with parallel dry strokes: the wax rides on the peaks of the paper+tooth and skips the pits, so every mass is peppered with white specks pulled into short streaks along the stroke,+and the strokes end hard and streaky -- each run of the stick's worn face gives out at its own place, a comb of+uneven teeth. Black crayon accents only where they matter (eyes, brows, a nostril, a few contour and fold marks),+never a full outline. Faces are the paper itself with a few peach strokes on the shadow side, two hatched orange+blush patches and flat red-orange lips -- simplified, a little lopsided, expressive. Hair is a few loose energetic+strokes; stripes on knitwear are short bold dashes.++Physical model+ paper White cold-press paper with a visible tooth `T` (rank-equalised to a uniform 0..1, so that "the wax+ catches where tooth > 1 - pressure" turns pressure straight into coverage), a faint mottle, and the+ tooth pre-averaged along 8 directions (`TD`, uint8, dragged further than for soft pastel) so the pits a+ stroke skips become short white streaks along it. The blank paper keeps about 3-4 levels of tooth+ shading (it is not a flat digital white).+ strokes A stroke is a short centreline integrated through an orientation field (angles mod pi), drawn with a+ stick of constant width. Thousands go at once: Pillow draws every *segment* of every stroke with its+ own id into a 2x supersampled integer map; numpy looks each covered sub-pixel up to its segment and+ recovers its position along the stroke (u) and across it (v). The stick's worn face is split into+ lanes across the stroke; each lane has its own pressure (lengthwise streaks), its own small value shift+ (some lanes lighter or a second colour mixed in: `mix`) and its own end -- the lanes give out one by one+ over the last `dry` part of the stroke, so the stroke ends in a hard, uneven comb, not a soft fade. The+ start is blunt and full. Wax only lands where the pressure reaches the direction-matched tooth, with a+ steep threshold (crisp white specks, not a soft grain), and sums back with bincount; big batches are+ split into bands of rows to keep memory down.+ wax Opaque: new = old + A x (target - old), target = (1 - opacity) x old x colour + opacity x colour; a+ stroke also drags a little of the wax already there into its own colour (`smear`, scaled by the wax+ buffer `F`). `F` records how much wax sits on the paper, so later layers fill more of the tooth.+ edges A mass is clipped to its mask with a broken edge: the mask's rim is thresholded against a mid-scale+ noise plus the tooth (`edge`), so the outline breaks into the paper like a dragged stick, and strokes+ left unclipped at one end (`spill`) run out past the shape in streaky teeth.+ accents `crayon()` a scratchy black line: the path wobbles and is split into overlapping pieces of different+ widths (the hand lifts and presses), each a narrow dry stroke with its own tooth skipping, sometimes+ doubled by a thinner offset stroke. `blush()` a patch of parallel hatched strokes in a ragged ellipse.+ `dashes()` short bold dashes along a path (stripes on knitwear, a fringe). `smear()` a dry-brushed+ cast shadow or a smear of sky: long dry strokes with big skips. `wisp()` a rising curl (steam, breath).+ faces `eye()` a black crayon eye: the opening between a lowered upper lid (a downward gaze) and the lower+ lid, a big dark iris seen only inside it with a paper gap left as the catchlight, a heavy upper-lid+ stroke that thickens and flicks out at the outer corner, a faint peach crease and a light lower mark;+ `brow()` one chunky stroke and a few short hairs; `lips()` a flat red-orange mouth laid in short dense+ strokes with a darker parting; `hair()` long energetic strokes that start on a root line (or land in+ a region), follow a field with a strong bend and thin to a point.+ finish `finish()` records the finishing, applied in render so every stage snapshot matches: the tooth showing+ through the wax, a little waxy relief at the edges of the deposit (lit from the upper left), a faint+ grain and a very slight softening.++API (canvas pixel coordinates; a number given as a field is a direction in degrees, 0 = to the right, 90 = down;+ field arrays are radians; colours are PAINTS names, '#rrggbb' or RGB triples)+ surface OilPastel(W, H, seed, keep_stages, stages_dir); paper(tone, tooth, drag); finish(tooth, relief, grain,+ soft) -- call finish() before the first mark+ masks poly(pts, smooth) / ellipse(cx, cy, rx, ry, rot) / blob(cx, cy, rx, ry, rough) / tube(path, w0, w1) /+ rect(x0, y0, x1, y1) / below(xs, ys) -> canvas-sized float masks; spot(cx, cy, rx, ry, rot, solid) a+ soft field; soften(mask, sigma)+ fields flow(angle, turb, scale); field(f(x, y) -> degrees) -- or pass f itself; radial(cx, cy, offset);+ contour(mask, sigma, offset, fallback); blend(f1, f2, w); rotate(field, deg)+ strokes fill(region, field, colour, length, width, density, pressure, alpha, dry, streak, smear, opacity,+ mix, spill, edge, passes, clip, avoid, fade); lines(paths, colour, width, pressure, ...); stroke(path,+ width, colour, ...)+ accents crayon(path, width, colour, pressure, wobble, seg, gap, double); blush(cx, cy, rx, ry, colour,+ angle, strength); dashes(path, colour, spacing, length, width, angle); smear(region, colour, angle,+ length, width); wisp(x, y, height, sway, colour, width)+ faces eye(cx, cy, w, h, look, lid, side, rot, lower, lash, iris, crease); brow(path, width); lips(cx, cy, w,+ h, smile, rot, side, parting); hair(region, flow, colours, n, length, width, bend, pressure, dry, taper,+ roots, clip)+ output render(); composite(); stage(name); save(path, stages_dir) -- save('x.jpg') quality 88, 4:4:4 chroma++ import sys; sys.path.insert(0, 'lib')+ from oilpastel import OilPastel+ p = OilPastel(1200, 1200, seed=3); p.finish(); p.paper()+ body = p.poly([(300, 1100), (330, 760), (600, 700), (870, 760), (900, 1100)], smooth=True)+ p.fill(body, -95, {'navy': 3, 'black': 1}, length=(120, 260), width=(30, 48), spill=(0, 60))+ p.eye(560, 470, 46, 20, look=(0, 0.4)); p.eye(680, 470, 46, 20, look=(0, 0.4))+ p.blush(540, 540, 46, 34); p.blush(700, 540, 46, 34)+ p.lips(615, 600, 64, 26)+ p.save('pastel.jpg')+"""+import io+import os+import numpy as np+from PIL import Image, ImageDraw+from core import blur, spline, noise2d, smoothstep, blob_pts++PAINTS = {+ # paper and crayon black+ 'paper': '#f6f5f1', 'white': '#fbfaf6', 'black': '#131716', 'charcoal': '#2b2f30',+ 'warmgrey': '#9a928a', 'grey': '#c2bdb6',+ # the navy family (a teal navy) and the blues+ 'navy_deep': '#0d2631', 'navy': '#15404f', 'navy_light': '#245a6d', 'indigo': '#1c3866', 'cobalt': '#1f5f8c',+ 'cool_deep': '#3b6a94', 'cool': '#5a8cb6', 'cool_light': '#8db2cf', 'mist': '#bccbd6',+ # the saffron family+ 'saffron_deep': '#e27c15', 'saffron': '#f39a20', 'marigold': '#f6b23a', 'yellow': '#f8c94c', 'butter': '#fadf8c',+ 'orange': '#ee772a', 'ochre': '#c98d36',+ # skin, blush and lips+ 'skin_pale': '#f5e5d7', 'peach_light': '#f6bc98', 'peach': '#f09768', 'peach_deep': '#e27c4c',+ 'skin_tan': '#d4956a', 'skin_brown': '#7c4f3b', 'skin_deep': '#3e302c',+ 'blush': '#ee7a34', 'blush_light': '#f3a065', 'vermilion': '#f2461a', 'lip': '#f24a1c', 'lip_dark': '#bd2f17',+ # extras+ 'olive': '#3b5a2c', 'moss': '#64803a', 'kraft': '#c79b5f', 'kraft_dark': '#a2763f', 'rust': '#b9532a',+}+LIGHT = (-0.62, -0.62) # the relief light: from the upper left+++def hexc(c):+ """'#rrggbb', a PAINTS name or an RGB triple -> float32 RGB in 0..1"""+ if not isinstance(c, str): return np.asarray(c, np.float32)+ h = PAINTS.get(c, c).lstrip('#')[:6]+ return np.array([int(h[i:i + 2], 16) for i in (0, 2, 4)], np.float32) / 255+++def mix(a, b, t):+ return hexc(a) * (1 - t) + hexc(b) * t+++def _equalise(a):+ """rank-equalise to a uniform 0..1 distribution"""+ flat = a.ravel()+ o = np.argsort(flat, kind='stable')+ out = np.empty(flat.size, np.float32)+ out[o] = np.linspace(0, 1, flat.size, dtype=np.float32)+ return out.reshape(a.shape)+++def _lookup(field, x, y):+ if callable(field): return np.deg2rad(np.asarray(field(x, y), np.float32)).astype(np.float32)+ if np.ndim(field) == 0: return np.full(len(x), float(field), np.float32)+ H, W = field.shape[:2]+ return field[np.clip(y.astype(np.int32), 0, H - 1), np.clip(x.astype(np.int32), 0, W - 1)]+++def _resample(P, step):+ P = np.asarray(P, np.float32)+ d = np.r_[0, np.cumsum(np.linalg.norm(np.diff(P, axis=0), axis=1))]+ if d[-1] < 1e-3: return P[:1]+ s = np.linspace(0, d[-1], max(2, int(d[-1] / step) + 1))+ return np.stack([np.interp(s, d, P[:, 0]), np.interp(s, d, P[:, 1])], 1).astype(np.float32)+++def _resample_k(P, k):+ """resample a polyline to exactly k points by arc length"""+ P = np.asarray(P, np.float32)+ if len(P) == 1: return np.repeat(P, k, 0)+ d = np.r_[0, np.cumsum(np.linalg.norm(np.diff(P, axis=0), axis=1))]+ if d[-1] < 1e-4: return np.repeat(P[:1], k, 0)+ s = np.linspace(0, d[-1], k)+ return np.stack([np.interp(s, d, P[:, 0]), np.interp(s, d, P[:, 1])], 1).astype(np.float32)+++def _hash(a, b):+ h = np.sin(a * 12.9898 + b * 78.233) * 43758.5453+ return (h - np.floor(h)).astype(np.float32)+++def _smooth_path(path, per=8):+ P = np.asarray(path, np.float32)+ return spline(P, per) if len(P) > 2 else _resample(P, 4)+++class OilPastel:+ PAINTS = PAINTS++ def __init__(self, W=1600, H=1600, seed=0, keep_stages=True, stages_dir=None):+ if W * H > 4096 * 4096: raise ValueError('canvas larger than 4096 x 4096')+ self.W, self.H, self.seed = W, H, seed+ self.rng = np.random.default_rng(seed)+ self.keep_stages, self.stages_dir = keep_stages, stages_dir+ self.stages, self._n_stages = [], 0+ self.YY, self.XX = np.mgrid[0:H, 0:W].astype(np.float32)+ self.C = np.empty((H, W, 3), np.float32); self.C[:] = hexc('paper')+ self.F = np.zeros((H, W), np.float32) # wax already on the paper+ self.T = None; self.TD = None; self.EN = None+ self.fin = None+ self.floor = 0.03 # wax a stick still pushes into the pits+ self.band_px = 0.6e6 # sub-pixels per raster band (memory vs. speed)+ self.n_strokes = 0+ self._sid = 0 # running stroke id (per-lane randomness)++ def _r(self, seed=None):+ return np.random.default_rng(int(self.rng.integers(1 << 30)) if seed is None else seed)++ # ================================================================== paper+ def paper(self, tone='paper', tooth=1.0, drag=5, seed=None):+ """white cold-press paper: an equalised tooth that shows as a faint grain on the blank paper, and the tooth+ dragged along 8 stroke directions (the pits a stick skips become streaks along it)"""+ H, W = self.H, self.W+ r = self._r(seed)+ z = lambda a: (a - a.mean()) / (a.std() + 1e-6)+ g1 = blur(r.random((H, W)).astype(np.float32), 0.7)+ g2 = noise2d(H, W, 3.2, 2, int(r.integers(1 << 30)))+ g3 = noise2d(H, W, 9.0, 2, int(r.integers(1 << 30)))+ self.T = _equalise(0.75 * z(g1) + 0.55 * z(g2) + 0.18 * z(g3))+ del g1, g2, g3+ mot = noise2d(H, W, 260, 3, int(r.integers(1 << 30))) - 0.5+ self.C = (hexc(tone)[None, None] * (1 + 0.012 * mot[..., None] + 0.05 * tooth * (self.T[..., None] - 0.5))+ ).astype(np.float32)+ del mot+ self.F[:] = 0+ TD = np.empty((8, H, W), np.uint8)+ ks = np.arange(-drag, drag + 1); wk = 1.0 - np.abs(ks) / (drag + 1.0)+ for b in range(8):+ a = np.pi * b / 8+ acc = np.zeros_like(self.T)+ for k, w in zip(ks, wk):+ acc += w * np.roll(self.T, (int(round(k * np.sin(a))), int(round(k * np.cos(a)))), axis=(0, 1))+ TD[b] = np.round(_equalise(0.3 * self.T + 0.7 * acc / wk.sum()) * 255).astype(np.uint8)+ del acc+ self.TD = TD+ self.EN = (noise2d(H, W, 7.0, 3, int(r.integers(1 << 30))) - 0.5).astype(np.float32)+ self.EN2 = noise2d(H, W, 26.0, 2, int(r.integers(1 << 30))).astype(np.float32) # ragged run-out lengths+ rg = np.random.default_rng(self.seed + 7)+ self._grain = rg.standard_normal((H, W), dtype=np.float32)+ return self++ def _need(self):+ if self.T is None: self.paper()++ # ================================================================== masks+ def poly(self, pts, smooth=False, ss=2):+ """filled polygon -> canvas-sized float mask (smooth=True: a closed Catmull-Rom spline through the points)"""+ P = np.asarray(pts, np.float32)+ if smooth:+ Q = np.vstack([P[-1:], P, P[:2]])+ P = spline(Q, 10)[10:-10]+ out = np.zeros((self.H, self.W), np.float32)+ x0, y0 = max(0, int(np.floor(P[:, 0].min())) - 1), max(0, int(np.floor(P[:, 1].min())) - 1)+ x1, y1 = min(self.W, int(np.ceil(P[:, 0].max())) + 2), min(self.H, int(np.ceil(P[:, 1].max())) + 2)+ if x1 <= x0 or y1 <= y0: return out+ im = Image.new('L', ((x1 - x0) * ss, (y1 - y0) * ss), 0)+ ImageDraw.Draw(im).polygon([((float(x) - x0) * ss, (float(y) - y0) * ss) for x, y in P], fill=255)+ out[y0:y1, x0:x1] = np.asarray(im.resize((x1 - x0, y1 - y0), Image.BOX), np.float32) / 255+ return out++ def ellipse(self, cx, cy, rx, ry=None, rot=0.0):+ """anti-aliased ellipse mask (rot in degrees)"""+ ry = rx if ry is None else ry+ c, s = np.cos(np.deg2rad(rot)), np.sin(np.deg2rad(rot))+ R = max(rx, ry)+ x0, x1 = max(0, int(cx - R - 3)), min(self.W, int(cx + R + 4))+ y0, y1 = max(0, int(cy - R - 3)), min(self.H, int(cy + R + 4))+ out = np.zeros((self.H, self.W), np.float32)+ if x1 <= x0 or y1 <= y0: return out+ dx, dy = self.XX[y0:y1, x0:x1] - cx, self.YY[y0:y1, x0:x1] - cy+ u, v = (dx * c + dy * s) / rx, (-dx * s + dy * c) / ry+ out[y0:y1, x0:x1] = np.clip((1 - np.sqrt(u * u + v * v)) * min(rx, ry) + 0.5, 0, 1)+ return out++ def blob(self, cx, cy, rx, ry=None, rough=0.1, seed=None, rot=0.0):+ ry = rx if ry is None else ry+ return self.poly(blob_pts(cx, cy, rx, ry, rough, 120, int(self._r(seed).integers(1 << 30)), np.deg2rad(rot)))++ @staticmethod+ def tube_pts(path, w0, w1=None, per=8):+ """outline points of a tube of width w0 -> w1 along a path (an arm, a scarf end); w0 may be a list"""+ w1 = w0 if w1 is None else w1+ P = spline(path, per) if len(path) > 2 else _resample(path, 4)+ n = len(P)+ Tg = np.gradient(P, axis=0); Tg /= np.linalg.norm(Tg, axis=1, keepdims=True) + 1e-6+ Nn = np.stack([-Tg[:, 1], Tg[:, 0]], 1)+ w = (np.linspace(w0, w1, n) if np.ndim(w0) == 0+ else np.interp(np.linspace(0, 1, n), np.linspace(0, 1, len(w0)), w0))+ w = np.asarray(w, np.float32)[:, None] * 0.5+ return np.vstack([P + Nn * w, (P - Nn * w)[::-1]])++ def tube(self, path, w0, w1=None):+ return self.poly(self.tube_pts(path, w0, w1))++ def rect(self, x0, y0, x1, y1):+ X, Y = self.XX, self.YY+ return (np.clip(X - x0 + 0.5, 0, 1) * np.clip(x1 - X + 0.5, 0, 1) *+ np.clip(Y - y0 + 0.5, 0, 1) * np.clip(y1 - Y + 0.5, 0, 1)).astype(np.float32)++ def below(self, xs, ys, invert=False):+ """mask of everything below a line through (xs, ys) (spline), or a constant y if xs is None"""+ if xs is None:+ m = np.clip(self.YY - float(ys) + 0.5, 0, 1)+ else:+ x = np.arange(self.W, dtype=np.float32)+ P = spline(np.stack([np.asarray(xs, np.float32), np.asarray(ys, np.float32)], 1), 12)+ o = np.argsort(P[:, 0])+ yl = np.interp(x, P[o, 0], P[o, 1]).astype(np.float32)+ m = np.clip(self.YY - yl[None] + 0.5, 0, 1)+ return (1 - m if invert else m).astype(np.float32)++ def spot(self, cx, cy, rx, ry=None, rot=0.0, solid=0.3, power=1.2):+ """a soft 0..1 field: 1 inside `solid` of the ellipse, easing to 0 at its rim"""+ ry = rx if ry is None else ry+ c, s = np.cos(np.deg2rad(rot)), np.sin(np.deg2rad(rot))+ R = max(rx, ry)+ x0, x1 = max(0, int(cx - R - 2)), min(self.W, int(cx + R + 3))+ y0, y1 = max(0, int(cy - R - 2)), min(self.H, int(cy + R + 3))+ out = np.zeros((self.H, self.W), np.float32)+ if x1 <= x0 or y1 <= y0: return out+ dx, dy = self.XX[y0:y1, x0:x1] - cx, self.YY[y0:y1, x0:x1] - cy+ d = np.sqrt(((dx * c + dy * s) / rx) ** 2 + ((-dx * s + dy * c) / ry) ** 2)+ out[y0:y1, x0:x1] = smoothstep(1.0, solid, d) ** power+ return out++ def soften(self, mask, sigma):+ """a blurred copy of a mask, blurred only round the shape"""+ out = np.zeros((self.H, self.W), np.float32)+ bb = self._bbox(mask, pad=int(3 * sigma) + 4)+ if bb is None: return out+ x0, y0, x1, y1 = bb+ out[y0:y1, x0:x1] = blur(mask[y0:y1, x0:x1].astype(np.float32), sigma)+ return out++ def _mask(self, region):+ if isinstance(region, np.ndarray): return region.astype(np.float32, copy=False)+ x0, y0, x1, y1 = (int(round(v)) for v in region)+ M = np.zeros((self.H, self.W), np.float32)+ M[max(0, y0):max(0, y1), max(0, x0):max(0, x1)] = 1+ return M++ @staticmethod+ def _bbox(M, thr=0.004, pad=0):+ rows = np.flatnonzero(M.max(1) > thr); cols = np.flatnonzero(M.max(0) > thr)+ if not len(rows) or not len(cols): return None+ H, W = M.shape+ return (max(0, cols[0] - pad), max(0, rows[0] - pad), min(W, cols[-1] + 1 + pad), min(H, rows[-1] + 1 + pad))++ # ================================================================== fields+ def flow(self, angle=0.0, turb=8.0, scale=240.0, seed=None):+ """orientation field: `angle` degrees with +-turb degrees of low-frequency wander at `scale` px"""+ n = noise2d(self.H, self.W, scale, 3, int(self._r(seed).integers(1 << 30))) - 0.5+ return np.deg2rad(angle + 2 * turb * n).astype(np.float32)++ def field(self, f):+ """an orientation field from f(x, y) -> degrees, evaluated on the whole canvas"""+ return np.deg2rad(np.asarray(f(self.XX, self.YY), np.float32)).astype(np.float32)++ def radial(self, cx, cy, offset=0.0):+ """directions pointing away from (cx, cy), offset in degrees"""+ return (np.arctan2(self.YY - cy, self.XX - cx) + np.deg2rad(offset)).astype(np.float32)++ def contour(self, mask, sigma=8.0, offset=0.0, fallback=None):+ """directions along the iso-lines of a (blurred) shape: strokes that wrap round a roll of scarf, a sleeve.+ Only computed round the shape (outside it: `fallback` degrees or 0)."""+ if isinstance(fallback, np.ndarray): out = fallback.astype(np.float32).copy()+ else: out = np.full((self.H, self.W), 0 if fallback is None else np.deg2rad(fallback), np.float32)+ bb = self._bbox(mask, pad=int(3 * sigma) + 4)+ if bb is None: return out+ x0, y0, x1, y1 = bb+ d = blur(mask[y0:y1, x0:x1].astype(np.float32), sigma)+ gy, gx = np.gradient(d)+ a = np.arctan2(gy, gx) + np.pi / 2 + np.deg2rad(offset)+ if fallback is not None:+ g = np.hypot(gx, gy)+ w = smoothstep(0.0, 0.25 / max(sigma, 1.0), g)+ fb = np.deg2rad(fallback) if np.ndim(fallback) == 0 else fallback[y0:y1, x0:x1]+ a = self.blend(np.broadcast_to(np.float32(fb), a.shape) if np.ndim(fb) == 0 else fb, a, w)+ out[y0:y1, x0:x1] = a+ return out++ @staticmethod+ def blend(f1, f2, w):+ """blend two orientation fields (doubled-angle average, so 0 and pi are the same orientation)"""+ w = np.asarray(w, np.float32)+ c = (1 - w) * np.cos(2 * f1) + w * np.cos(2 * f2)+ s = (1 - w) * np.sin(2 * f1) + w * np.sin(2 * f2)+ return (0.5 * np.arctan2(s, c)).astype(np.float32)++ @staticmethod+ def rotate(field, deg):+ if np.ndim(field) == 0: return float(field) + deg+ return (field + np.deg2rad(deg)).astype(np.float32)++ # ================================================================== stroke machinery+ def _sizes(self, spec, x, y, r):+ n = len(x)+ if callable(spec):+ return (np.asarray(spec(x, y), np.float32) * r.uniform(0.85, 1.15, n)).astype(np.float32)+ if np.ndim(spec) == 0: return np.full(n, float(spec), np.float32) * r.uniform(0.88, 1.12, n).astype(np.float32)+ return r.uniform(spec[0], spec[1], n).astype(np.float32)++ def _colours(self, spec, x, y, r):+ """'canvas' (the colour under the point) | paint | list of paints (picked at random) | {paint: weight} |+ f(x, y) -> (N, 3) | RGB"""+ n = len(x)+ if isinstance(spec, str) and spec == 'canvas': return _lookup(self.C, x, y).astype(np.float32).copy()+ if callable(spec): return np.asarray(spec(x, y), np.float32).reshape(n, 3).copy()+ if isinstance(spec, dict):+ names = list(spec); w = np.array([spec[k] for k in names], np.float64); w /= w.sum()+ R = np.stack([hexc(c) for c in names])+ return R[r.choice(len(names), n, p=w)].astype(np.float32)+ if isinstance(spec, str): return np.broadcast_to(hexc(spec), (n, 3)).astype(np.float32).copy()+ if isinstance(spec, (tuple, list)) and all(isinstance(c, str) for c in spec):+ R = np.stack([hexc(c) for c in spec])+ return R[r.integers(0, len(R), n)].astype(np.float32)+ return np.broadcast_to(hexc(spec), (n, 3)).astype(np.float32).copy()++ @staticmethod+ def _field_rad(field):+ if callable(field): return field+ return np.float32(np.deg2rad(field)) if np.ndim(field) == 0 else field++ def _centrelines(self, x, y, L, field, jit, bend, k):+ """integrate k points through an orientation field from the centre outward (no flips)"""+ n = len(x)+ P = np.zeros((n, k, 2), np.float32)+ c = k // 2+ P[:, c, 0] = x; P[:, c, 1] = y+ st = L / (k - 1)+ a0 = _lookup(field, x, y) + jit+ d0 = np.stack([np.cos(a0), np.sin(a0)], 1).astype(np.float32)+ for sgn in (1, -1):+ px, py = x.copy(), y.copy()+ prev = d0 * sgn+ for j in range(1, (k - c) if sgn > 0 else (c + 1)):+ a = _lookup(field, px, py) + jit + sgn * bend * j+ v = np.stack([np.cos(a), np.sin(a)], 1).astype(np.float32)+ flip = (v * prev).sum(1) < 0+ v[flip] *= -1+ px = px + v[:, 0] * st; py = py + v[:, 1] * st+ P[:, c + sgn * j, 0] = px; P[:, c + sgn * j, 1] = py+ prev = v+ return P++ def _seed_points(self, M, bb, n_cells, r):+ """stratified (jittered-grid) candidate points over a box, accepted with probability M"""+ x0, y0, x1, y1 = bb+ bw, bh = x1 - x0, y1 - y0+ cell = max(1.0, np.sqrt(bw * bh / max(1, n_cells)))+ nx, ny = max(1, int(np.ceil(bw / cell))), max(1, int(np.ceil(bh / cell)))+ gx, gy = np.meshgrid(np.arange(nx, dtype=np.float32), np.arange(ny, dtype=np.float32))+ x = x0 + (gx.ravel() + r.random(nx * ny).astype(np.float32)) * cell+ y = y0 + (gy.ravel() + r.random(nx * ny).astype(np.float32)) * cell+ ok = (x < x1) & (y < y1)+ x, y = x[ok], y[ok]+ keep = r.random(len(x)) < _lookup(M, x, y)+ return x[keep], y[keep]++ def _edge_clip(self, M, edge, spill=None):+ """the clip of a mass: its rim thresholded against noise + tooth, so the edge breaks like a dragged stick.+ spill = (dx, dy): the mask is smeared up to that far that way, each stretch of the edge its own distance+ (the strokes run out past the shape in a ragged comb, not to a ruled line)"""+ S = M+ if spill is not None:+ dx, dy = spill+ S = M.copy()+ n = 24+ reach = np.clip(0.15 + 1.1 * self.EN2, 0, 1)+ for i in range(1, n + 1):+ sx, sy = int(round(dx * i / n)), int(round(dy * i / n))+ sh = np.zeros_like(M)+ ys0, ys1 = max(0, sy), min(self.H, self.H + sy)+ xs0, xs1 = max(0, sx), min(self.W, self.W + sx)+ sh[ys0:ys1, xs0:xs1] = M[ys0 - sy:ys1 - sy, xs0 - sx:xs1 - sx]+ sh *= smoothstep(i / n - 0.08, i / n, reach)+ np.maximum(S, sh, out=S)+ del sh+ g = smoothstep(0.0, 1.0, S)+ rim = (g > 0.01) & (g < 0.99)+ out = g.copy()+ out[rim] = np.clip((g[rim] - 0.5) * 2.2 + 0.5 + edge * (0.9 * self.EN[rim] + 0.35 * (self.T[rim] - 0.5)), 0, 1)+ return out++ def fill(self, region, field=-90.0, colour='navy', length=(70, 160), width=(26, 44), density=2.6, pressure=0.92,+ alpha=1.0, dry=0.3, streak=0.4, smear=0.12, opacity=0.94, mix=None, spill=None, edge=0.5, soft=0.16,+ taper=0.08, jitter=0.08, bend=0.02, value=0.05, lane_value=0.05, hue=0.0, passes=3, clip='auto',+ avoid=None, fade=None, k=5, sidep=0.12, seed=None):+ """scumble-fill `region` (a 0..1 landing-probability mask or a box) with parallel dry waxy strokes along+ `field` (degrees or a radians field, or f(x, y) -> degrees). density ~ how many times the strokes tile the+ region; length / width: (lo, hi), a number or f(x, y); colour: a paint, a list (picked at random), a dict+ {paint: weight}, 'canvas' or f(x, y) -> (N, 3); pressure: how deep the wax reaches into the tooth (lower =+ more white specks); dry: the last part of each stroke over which its lanes give out (streaky ends);+ streak: how much weaker some lanes are (lengthwise streaks); smear: how much of the wax already there the+ stick drags along; opacity: how fully a stroke covers what is under it; mix = (paint, fraction) mixes a+ second colour into some lanes; spill = (dx, dy) lets the strokes run out past the shape that way; edge: how+ broken the clipped rim is; clip: a mask the strokes are cut to ('auto' = the region with a broken rim);+ fade: a 0..1 field easing the pressure off; avoid: a mask to leave alone. Returns the number of strokes."""+ self._need()+ r = self._r(seed)+ M = self._mask(region)+ if avoid is not None:+ keep = 1 - np.clip(avoid, 0, 1)+ M = M * keep+ bb = self._bbox(M)+ if bb is None: return 0+ x0, y0, x1, y1 = bb+ if float(M[y0:y1, x0:x1].sum()) < 1: return 0+ sx = r.uniform(x0, x1, 600).astype(np.float32); sy = r.uniform(y0, y1, 600).astype(np.float32)+ Lm = float(self._sizes(length, sx, sy, r).mean()); Wm = float(self._sizes(width, sx, sy, r).mean())+ n_cells = int(density * (x1 - x0) * (y1 - y0) / (0.8 * Lm * Wm)) + 1+ arr = isinstance(region, np.ndarray)+ x, y = self._seed_points(np.sqrt(M) if arr else M, bb, n_cells, r)+ n = len(x)+ if not n: return 0+ o = r.permutation(n); x, y = x[o], y[o]+ L = self._sizes(length, x, y, r); Wd = self._sizes(width, x, y, r)+ cols = self._colours(colour, x, y, r)+ if value: cols *= (1 + value * r.normal(0, 1, n).astype(np.float32))[:, None]+ if hue:+ g = cols.mean(1, keepdims=True)+ cols = g + (cols - g) * (1 + hue * r.normal(0, 1, (n, 1)).astype(np.float32))+ cols = np.clip(cols, 0, 1)+ P = self._centrelines(x, y, L, self._field_rad(field), (jitter * r.normal(0, 1, n)).astype(np.float32),+ (bend * r.normal(0.5, 0.7, n)).astype(np.float32), k)+ if isinstance(clip, str) and clip == 'auto':+ clip = self._edge_clip(M, edge, spill) if arr else None+ if avoid is not None:+ clip = keep if clip is None else clip * keep+ pr = np.broadcast_to(np.asarray(pressure, np.float32), (n,)) * r.uniform(0.9, 1.06, n).astype(np.float32)+ al = np.broadcast_to(np.asarray(alpha, np.float32), (n,)) * r.uniform(0.9, 1.0, n).astype(np.float32)+ dr = np.broadcast_to(np.asarray(dry, np.float32), (n,)) * r.uniform(0.6, 1.3, n).astype(np.float32)+ st = np.broadcast_to(np.asarray(streak, np.float32), (n,)) * r.uniform(0.6, 1.3, n).astype(np.float32)+ self._draw(P, Wd, cols, al, pr, dr, st, taper, opacity, smear, mix, lane_value, clip, fade, passes, soft, r,+ sidep=sidep)+ self.n_strokes += n+ return n++ def lines(self, paths, colour='black', width=8.0, pressure=0.9, alpha=1.0, dry=0.2, streak=0.3, smear=0.08,+ opacity=0.95, mix=None, soft=0.22, taper=0.1, value=0.03, lane_value=0.04, clip=None, fade=None,+ passes=1, k=None, seed=None, sidep=0.2):+ """draw explicit strokes: a list of polylines (each (m, 2)), resampled to k points each; painted in order+ (later on top) within each pass. width / pressure / dry may be numbers, (lo, hi) or per-path lists."""+ self._need()+ r = self._r(seed)+ if not len(paths): return 0+ if k is None: k = max(3, min(13, int(np.median([len(p) for p in paths]))))+ P = np.stack([_resample_k(np.asarray(p, np.float32), k) for p in paths]).astype(np.float32)+ n = len(P)+ mid = P[:, k // 2]++ def per(spec, lo=0.92, hi=1.06):+ if isinstance(spec, (list, np.ndarray)) and len(spec) == n:+ return np.asarray(spec, np.float32)+ if isinstance(spec, tuple): return r.uniform(spec[0], spec[1], n).astype(np.float32)+ return np.full(n, float(spec), np.float32) * r.uniform(lo, hi, n).astype(np.float32)+ Wd = per(width, 0.94, 1.06)+ cols = self._colours(colour, mid[:, 0], mid[:, 1], r)+ if value: cols = np.clip(cols * (1 + value * r.normal(0, 1, n).astype(np.float32))[:, None], 0, 1)+ pr = per(pressure, 0.95, 1.04); al = per(alpha, 1.0, 1.0); dr = per(dry, 0.7, 1.3); st = per(streak, 0.8, 1.2)+ self._draw(P, Wd, cols, al, pr, dr, st, taper, opacity, smear, mix, lane_value, clip, fade, passes, soft, r,+ sidep=sidep)+ self.n_strokes += n+ return n++ def stroke(self, path, width=24.0, colour='navy', **kw):+ """one explicit dry stroke along `path` (smoothed if it has more than two points)"""+ P = _smooth_path(path, 6)+ return self.lines([P], colour, width, k=int(np.clip(len(P), 3, 13)), **kw)++ def _draw(self, P, Wd, cols, al, pr, dr, st, taper, opacity, smear, mix, lane_value, clip, fade, passes, soft, r,+ ss=2, sidep=0.2):+ n = len(P)+ sp = np.broadcast_to(np.asarray(sidep, np.float32), (n,)).astype(np.float32)+ tw = np.broadcast_to(np.asarray(taper, np.float32), (n,)).astype(np.float32)+ so = np.broadcast_to(np.asarray(soft, np.float32), (n,)) * r.uniform(0.8, 1.2, n).astype(np.float32)+ nb = np.clip(Wd / r.uniform(3.0, 4.6, n), 1.6, 16).astype(np.float32) # lanes of the worn face+ sid = (self._sid + np.arange(n)).astype(np.float32) * 0.6180339 + float(self.seed % 997)+ self._sid += n+ if mix is not None:+ mc = hexc(mix[0]); mf = float(mix[1])+ else:+ mc = None; mf = 0.0+ passes = max(1, int(passes))+ my = P[:, P.shape[1] // 2, 1]+ for g in range(passes):+ sel = np.arange(g, n, passes)+ if not len(sel): continue+ lo = P[sel].reshape(-1, 2).min(0); hi = P[sel].reshape(-1, 2).max(0)+ area = (hi[0] - lo[0] + 2 * Wd.max()) * (hi[1] - lo[1] + 2 * Wd.max()) * ss * ss+ nband = int(np.clip(np.ceil(area / self.band_px), 1, 200))+ if nband > 1:+ edges = np.quantile(my[sel], np.linspace(0, 1, nband + 1))+ groups = [sel[(my[sel] >= edges[b]) & ((my[sel] < edges[b + 1]) | (b == nband - 1))]+ for b in range(nband)]+ else:+ groups = [sel]+ for gs in groups:+ if len(gs):+ self._raster(P[gs], Wd[gs], cols[gs], al[gs], pr[gs], dr[gs], st[gs], tw[gs], so[gs], nb[gs],+ sid[gs], sp[gs], opacity, smear, mc, mf, lane_value, clip, fade, ss)++ def _raster(self, P, Wd, cols, al, pr, dr, st, tw, so, nb, sid, sp, opacity, smear, mc, mf, lane_value, clip,+ fade, ss):+ n, k = P.shape[:2]+ ns = k - 1+ pad = float(Wd.max()) + 3+ lo = P.reshape(-1, 2).min(0) - pad; hi = P.reshape(-1, 2).max(0) + pad+ x0, y0 = max(0, int(np.floor(lo[0]))), max(0, int(np.floor(lo[1])))+ x1, y1 = min(self.W, int(np.ceil(hi[0]))), min(self.H, int(np.ceil(hi[1])))+ if x1 <= x0 or y1 <= y0: return+ w, h = x1 - x0, y1 - y0+ A = P[:, :-1]; B = P[:, 1:]+ seg = B - A+ sl = np.linalg.norm(seg, axis=2) + 1e-4+ D = seg / sl[..., None]+ cum = np.cumsum(sl, axis=1) - sl+ LT = sl.sum(1)+ # every segment drawn with its own id; segments lengthened so a bend leaves no notch+ ext = np.minimum(Wd[:, None] * 0.35, sl * 0.5)[..., None] * D+ ext[:, -1] = 0+ A2 = (A - np.array([x0, y0], np.float32)) * ss+ B2 = (B + ext - np.array([x0, y0], np.float32)) * ss+ im = Image.new('I', (w * ss, h * ss), 0)+ d = ImageDraw.Draw(im)+ a2 = A2.tolist(); b2 = B2.tolist()+ wi = np.maximum(1, np.round(Wd * ss)).astype(np.int32).tolist()+ for i in range(n):+ ai, bi, wv = a2[i], b2[i], wi[i]+ base = i * ns + 1+ for j in range(ns):+ d.line((ai[j][0], ai[j][1], bi[j][0], bi[j][1]), fill=base + j, width=wv)+ flat = np.asarray(im, dtype=np.int32).ravel()+ nz = np.flatnonzero(flat).astype(np.int32)+ del im+ if not len(nz): return+ sg = flat[nz]+ del flat+ W2 = w * ss+ sy = nz // W2; sx = nz - sy * W2+ del nz+ si = np.r_[0, np.repeat(np.arange(n), ns)]+ z1 = lambda a: np.r_[0, np.asarray(a, np.float32).ravel()].astype(np.float32)+ AX, AY = z1(A[..., 0]), z1(A[..., 1])+ DX, DY = z1(D[..., 0]), z1(D[..., 1])+ SL, CU = z1(sl), z1(cum)+ ang = np.mod(np.arctan2(D[..., 1], D[..., 0]), np.pi).ravel()+ BIN = np.r_[0, (np.round(ang / np.pi * 8).astype(np.int32) % 8)]+ stk = si[sg].astype(np.int32)+ X = (sx.astype(np.float32) + 0.5) * (1.0 / ss) + x0; Y = (sy.astype(np.float32) + 0.5) * (1.0 / ss) + y0+ rx = X - AX[sg]; ry = Y - AY[sg]+ t = np.clip(rx * DX[sg] + ry * DY[sg], 0, SL[sg])+ u = np.clip((CU[sg] + t) / LT[stk], 0, 1)+ del t+ sv = (rx * (-DY[sg]) + ry * DX[sg]) / (0.5 * Wd[stk] + 0.25)+ del rx, ry+ s0 = sid[stk]+ # the stick's sides are not ruled: a slow sideways waver along the stroke+ sv = sv + 0.1 * np.sin(u * LT[stk] / 37.0 + s0 * 5.3) + 0.05 * np.sin(u * LT[stk] / 11.0 + s0 * 2.1)+ # the stick: a blunt full start with rounded corners, a constant width (or tapering toward the end)+ wf = (1 - tw[stk] * u) * (0.55 + 0.45 * np.sqrt(np.clip(u / 0.05, 0, 1)))+ av = np.abs(sv) / np.maximum(wf, 0.05)+ lat = smoothstep(1.0, 1.0 - so[stk], av)+ # lanes across the worn face: each its own pressure, value and end (the comb of the streaky end)+ li = np.floor(np.clip(sv / np.maximum(wf, 0.05) * 0.5 + 0.5, 0, 0.999) * nb[stk]).astype(np.float32)+ h1 = _hash(s0, li); h2 = _hash(s0 + 3.17, li * 1.3 + 0.5); h3 = _hash(s0 + 7.31, li * 0.7 + 2.0)+ lp = 1 - st[stk] * 0.4 * h1 ** 1.6+ ue = 1 + 0.03 - (dr[stk] + 0.03) * (0.08 + 0.92 * h2 ** 0.8)+ ef = smoothstep(ue + 0.02, ue - 0.05, u) * (1 - np.minimum(1.6 * dr[stk], 0.5) * smoothstep(ue - 0.22, ue, u))+ sf = smoothstep(0.0, 0.025 + 0.03 * h3, u)+ p = pr[stk] * lp * ef * (0.7 + 0.3 * sf) * (1 - sp[stk] * np.clip(av, 0, 1) ** 2)+ del ef+ iy = y0 + sy // ss; ix = x0 + sx // ss+ if fade is not None:+ p = p * (0.35 + 0.65 * fade[iy, ix])+ Tt = self.TD[BIN[sg], iy, ix].astype(np.float32) * (1.0 / 255)+ # wax already on the paper takes more wax (a second layer covers the first), but the bare pits stay bare+ catch = np.clip((Tt + 0.55 * np.minimum(self.F[iy, ix], 1) - (1 - p)) * 7.0 + 0.5, 0, 1)+ catch = self.floor * np.clip(p, 0, 1) + (1 - self.floor) * catch+ del Tt+ Aa = al[stk] * catch * lat * sf+ lv = 1 + lane_value * (h3 - 0.5) * 2+ pix = (sy // ss) * w + (sx // ss)+ npx = w * h+ k2 = 1.0 / (ss * ss)+ a1 = np.bincount(pix, Aa, npx).astype(np.float32) * k2+ c3 = np.empty((npx, 3), np.float32)+ if mc is not None:+ mw = (h2 < mf).astype(np.float32)+ for ch in range(3):+ cc = cols[stk, ch] * (1 - mw) + mc[ch] * mw+ c3[:, ch] = np.bincount(pix, Aa * cc * lv, npx) * k2+ else:+ for ch in range(3):+ c3[:, ch] = np.bincount(pix, Aa * cols[stk, ch] * lv, npx) * k2+ a1 = a1.reshape(h, w); c3 = c3.reshape(h, w, 3)+ if clip is not None:+ cf = clip[y0:y1, x0:x1]+ a1 = a1 * cf; c3 = c3 * cf[..., None]+ if fade is not None:+ ff = fade[y0:y1, x0:x1]+ a1 = a1 * ff; c3 = c3 * ff[..., None]+ m = a1 > 1e-4+ if not m.any(): return+ col = np.clip(c3[m] / a1[m][:, None], 0, 1)+ Cb = self.C[y0:y1, x0:x1]+ Fb = self.F[y0:y1, x0:x1]+ old = Cb[m]+ if smear:+ sm = (smear * np.clip(Fb[m], 0, 1))[:, None]+ col = col * (1 - sm) + old * sm+ tgt = (1 - opacity) * old * col / np.maximum(hexc('paper'), 0.5) + opacity * col+ A1 = np.minimum(a1[m], 1)[:, None]+ Cb[m] = old + A1 * (tgt - old)+ Fb[m] = np.minimum(1.5, Fb[m] + a1[m] * 0.6)++ # ================================================================== accents+ def crayon(self, path, width=7.0, colour='black', pressure=0.92, alpha=1.0, wobble=1.2, seg=(50, 150), gap=0.08,+ double=0.35, dry=0.25, taper=0.1, clip=None, smooth=True, seed=None):+ """a scratchy crayon line along `path`: it wobbles, and is split into overlapping pieces of different+ widths and pressures (the hand lifts and presses again); `gap` is the chance that a join is left open;+ `double` the chance that a piece gets a thinner second stroke slightly off it (a scratchy, re-stated line)."""+ r = self._r(seed)+ P = _resample(_smooth_path(path, 8) if smooth else np.asarray(path, np.float32), 2.0)+ if len(P) < 2: return 0+ Tg = np.gradient(P, axis=0); Tg /= np.linalg.norm(Tg, axis=1, keepdims=True) + 1e-6+ Nn = np.stack([-Tg[:, 1], Tg[:, 0]], 1)+ nn = len(P)+ if wobble:+ off = np.interp(np.arange(nn), np.linspace(0, nn - 1, max(2, nn // 14)),+ r.normal(0, wobble, max(2, nn // 14)))+ P = P + Nn * off[:, None].astype(np.float32)+ paths, ws, ps = [], [], []+ i = 0+ while i < nn - 1:+ m = int(r.uniform(seg[0], seg[1]) / 2.0)+ j = min(nn, i + max(3, m))+ if nn - j < 6: j = nn+ piece = P[i:j]+ paths.append(piece); ws.append(width * r.uniform(0.72, 1.18)); ps.append(pressure * r.uniform(0.85, 1.04))+ if r.random() < double and len(piece) > 4:+ o = Nn[i:j] * (width * r.uniform(0.25, 0.5) * r.choice([-1, 1]))+ paths.append(piece + o); ws.append(width * r.uniform(0.4, 0.6))+ ps.append(pressure * r.uniform(0.6, 0.8))+ back = int(r.uniform(5, 12)) # the next piece starts over the end of this+ if r.random() < gap: back = -int(r.uniform(2, 5)) # ... or the hand lifts: a small break+ i = max(i + 2, j - back)+ return self.lines(paths, colour, ws, ps, alpha, dry, 0.4, 0.04, 0.97, None, 0.3, taper, 0.02, 0.04, clip,+ None, 1, None, int(r.integers(1 << 30)), sidep=0.5)++ def blush(self, cx, cy, rx, ry=None, colour='blush', angle=-58.0, strength=0.85, width=(7, 12), rot=0.0,+ clip=None, seed=None):+ """a cheek patch of parallel hatched strokes in a ragged ellipse: dense in the middle, broken at the rim"""+ ry = rx if ry is None else ry+ reg = self.spot(cx, cy, rx, ry, rot, solid=0.45, power=1.0)+ cl = self._edge_clip(self.ellipse(cx, cy, rx * 1.05, ry * 1.05, rot), 0.9)+ if clip is not None: cl = cl * clip+ return self.fill(reg, angle, colour, length=(0.55 * min(rx, ry), 1.1 * min(rx, ry)), width=width,+ density=2.6 * strength, pressure=0.6 + 0.3 * strength, dry=0.35, streak=0.45, smear=0.2,+ opacity=0.9, clip=cl, passes=2, value=0.05, seed=seed)++ def dashes(self, path, colour='navy', spacing=26.0, length=(26, 40), width=(11, 16), angle=90.0, jitter=7.0,+ pressure=0.92, dry=0.2, clip=None, along=0.0, seed=None):+ """short bold dashes centred along `path`, each turned `angle` degrees from the path (90 = across it):+ stripes on knitwear, the ribs of a cuff, a fringe"""+ r = self._r(seed)+ P = _resample(_smooth_path(path, 8), 1.0)+ if len(P) < 2: return 0+ d = np.r_[0, np.cumsum(np.linalg.norm(np.diff(P, axis=0), axis=1))]+ s = np.arange(spacing * r.uniform(0.2, 0.8), d[-1], spacing)+ if not len(s): return 0+ s = s + r.normal(0, spacing * 0.08, len(s))+ cx = np.interp(s, d, P[:, 0]); cy = np.interp(s, d, P[:, 1])+ Tg = np.gradient(P, axis=0)+ tx = np.interp(s, d, Tg[:, 0]); ty = np.interp(s, d, Tg[:, 1])+ a = np.arctan2(ty, tx) + np.deg2rad(angle + r.normal(0, jitter, len(s)))+ L = r.uniform(length[0], length[1], len(s)) if isinstance(length, tuple) else np.full(len(s), float(length))+ sh = (L * along)[:, None] * np.stack([np.cos(a), np.sin(a)], 1)+ c = np.stack([cx, cy], 1) + sh+ e = 0.5 * L[:, None] * np.stack([np.cos(a), np.sin(a)], 1)+ bend = r.normal(0, 0.06, len(s))[:, None] * L[:, None] * np.stack([-np.sin(a), np.cos(a)], 1)+ paths = [np.array([c[i] - e[i], c[i] + bend[i], c[i] + e[i]], np.float32) for i in range(len(s))]+ wd = r.uniform(width[0], width[1], len(s)) if isinstance(width, tuple) else np.full(len(s), float(width))+ return self.lines(paths, colour, list(wd), pressure, 1.0, dry, 0.35, 0.1, 0.96, None, 0.2, 0.12, 0.04, 0.05,+ clip, None, 1, 3, int(r.integers(1 << 30)))++ def smear(self, region, colour='black', angle=0.0, length=(90, 240), width=(18, 34), density=0.9, pressure=0.8,+ dry=0.55, streak=0.65, edge=0.9, seed=None, **kw):+ """a dry-brushed smear: a cast shadow on the ground, a smear of sky -- long dry strokes with big skips and+ torn ends"""+ return self.fill(region, angle, colour, length=length, width=width, density=density, pressure=pressure,+ dry=dry, streak=streak, edge=edge, passes=2, seed=seed, **kw)++ def wisp(self, x, y, height, sway=28.0, colour='mist', width=7.0, pressure=0.6, turns=1.6, lean=-0.15, seed=None):+ """a rising curl (steam, breath): an S-curve drawn as a light broken crayon line"""+ r = self._r(seed)+ t = np.linspace(0, 1, 40)+ ph = r.uniform(0, 2 * np.pi)+ xs = x + sway * np.sin(t * turns * 2 * np.pi + ph) * (0.4 + 0.6 * t) + lean * height * t+ ys = y - height * t+ return self.crayon(np.stack([xs, ys], 1), width, colour, pressure, alpha=0.9, wobble=0.6, seg=(70, 160),+ gap=0.1, double=0.1, dry=0.45, taper=0.5, smooth=False, seed=int(r.integers(1 << 30)))++ # ================================================================== faces+ def eye(self, cx, cy, w, h, look=(0.0, 0.0), lid=0.5, side=1, rot=0.0, colour='black', width=None, lower=0.4,+ lash=0.6, iris=0.42, crease=0.5, seed=None):+ """a black crayon eye of width w and height h (`side` = +1 if the outer corner is on the right): the opening+ between a lowered upper lid (`lid` 0..1: 0 wide open, 1 nearly shut -- a downward gaze) and the lower lid;+ a big dark iris (`iris` x w across, moved by `look` (dx, dy) in -1..1) seen only inside the opening, with a+ small paper gap as the catchlight; a heavy upper-lid stroke that thickens toward the outer corner and+ flicks out, a faint crease above it and a short light mark for the lower lid"""+ r = self._r(seed)+ width = max(3.0, 0.12 * w) if width is None else width+ c, s = np.cos(np.deg2rad(rot)), np.sin(np.deg2rad(rot))+ L = lambda pts: [(cx + u * c - v * s, cy + u * s + v * c) for u, v in pts]+ hw = 0.5 * w+ dl = lid * 0.55 * h+ up = [(-side * hw, 0.1 * h), (-side * 0.55 * hw, -0.36 * h + 0.8 * dl), (0, -0.48 * h + dl),+ (side * 0.6 * hw, -0.38 * h + 0.9 * dl), (side * hw, 0.02 * h)]+ lo = [(side * 0.55 * hw, 0.38 * h), (0, 0.48 * h), (-side * 0.55 * hw, 0.36 * h)]+ opening = self.poly(L(up + lo), smooth=True)+ ir = 0.5 * iris * w+ ic = L([(look[0] * 0.28 * hw, look[1] * 0.16 * h + 0.05 * h)])[0]+ disc = self.ellipse(ic[0], ic[1], ir, ir * 1.03)+ hl = self.ellipse(ic[0] - side * 0.28 * ir, ic[1] - 0.05 * ir, 0.2 * ir, 0.17 * ir)+ cut = disc * self.soften(opening, 0.8) * (1 - hl)+ n = self.fill(cut, rot + 75, {colour: 3, 'charcoal': 1}, length=(0.9 * ir, 1.8 * ir),+ width=(0.4 * ir, 0.65 * ir), density=3.0, pressure=0.96, dry=0.1, streak=0.2,+ clip=self._edge_clip(cut, 0.25), passes=2, seed=int(r.integers(1 << 30)))+ # the upper lid: one heavy stroke, heavier and longer at the outer corner+ n += self.crayon(L(up), width, colour, pressure=0.96, wobble=0.4, seg=(w * 0.7, w * 1.4), gap=0.0,+ double=0.4, dry=0.12, taper=0.2, seed=int(r.integers(1 << 30)))+ n += self.crayon(L([(side * 0.05 * hw, -0.47 * h + dl), (side * 0.62 * hw, -0.38 * h + 0.9 * dl),+ (side * 1.04 * hw, 0.0)]), width * 1.45, colour, pressure=0.98, wobble=0.3,+ seg=(w, w * 2), gap=0.0, double=0.0, dry=0.2, taper=0.35, seed=int(r.integers(1 << 30)))+ if lash:+ n += self.crayon(L([(side * 0.98 * hw, 0.0), (side * (1.0 + 0.3 * lash) * hw, -0.32 * h)]), width * 0.75,+ colour, pressure=0.9, wobble=0.0, seg=(w, w), gap=0.0, double=0.0, dry=0.3, taper=0.6,+ seed=int(r.integers(1 << 30)))+ if crease:+ n += self.crayon(L([(-side * 0.45 * hw, -0.62 * h), (side * 0.1 * hw, -0.82 * h),+ (side * 0.75 * hw, -0.62 * h)]),+ width * 0.5, 'peach_deep', pressure=0.55 + 0.35 * crease, wobble=0.4, seg=(w, w * 2),+ gap=0.0, double=0.0, dry=0.35, taper=0.4, seed=int(r.integers(1 << 30)))+ if lower:+ n += self.crayon(L(lo), width * 0.42, colour, pressure=0.45 + 0.45 * lower, wobble=0.3, seg=(w, w * 2),+ gap=0.0, double=0.0, dry=0.45, taper=0.5, seed=int(r.integers(1 << 30)))+ return n++ def brow(self, path, width=10.0, colour='black', pressure=0.9, seed=None):+ """a brow: one crayon stroke thicker at the head, with a few short hairs along it"""+ r = self._r(seed)+ P = _resample(_smooth_path(path, 8), 2.0)+ n = self.lines([P], colour, width, pressure, 1.0, 0.4, 0.5, 0.05, 0.97, None, 0.25, 0.4, 0.02, 0.04,+ seed=int(r.integers(1 << 30)), k=9, sidep=0.45)+ m = len(P)+ hairs = []+ for t in np.linspace(0.05, 0.8, 5):+ i = int(t * (m - 1)); j = min(m - 1, i + max(2, m // 5))+ o = r.normal(0, width * 0.15, 2)+ hairs.append(np.array([P[i] + o, P[j] + o * 0.5], np.float32))+ n += self.lines(hairs, colour, width * 0.45, pressure * 0.85, 1.0, 0.4, 0.3, 0.0, 0.97, None, 0.3, 0.5,+ seed=int(r.integers(1 << 30)), k=3)+ return n++ def lips(self, cx, cy, w, h, colour='lip', dark='lip_dark', smile=0.0, rot=0.0, side=0.0, parting=0.7, seed=None):+ """a flat red-orange mouth of width w and height h laid in short dense strokes: an upper lip with a soft+ bow, a fuller lower lip, a darker parting; side shifts the bow (a three-quarter view), smile lifts the+ corners"""+ r = self._r(seed)+ c, s = np.cos(np.deg2rad(rot)), np.sin(np.deg2rad(rot))+ L = lambda pts: [(cx + u * c - v * s, cy + u * s + v * c) for u, v in pts]+ hw = 0.5 * w; b = side * 0.18 * hw; sm = smile * 0.35 * h+ upper = L([(-hw, -sm), (-0.55 * hw + b, -0.42 * h), (-0.12 * hw + b, -0.5 * h), (b, -0.36 * h),+ (0.14 * hw + b, -0.52 * h), (0.6 * hw + b, -0.4 * h), (hw, -sm), (0.3 * hw + b, 0.02 * h),+ (-0.3 * hw + b, 0.02 * h)])+ lower = L([(-0.92 * hw, -sm * 0.9), (-0.3 * hw + b, 0.05 * h), (0.32 * hw + b, 0.05 * h),+ (0.92 * hw, -sm * 0.9), (0.6 * hw + b, 0.42 * h), (b, 0.56 * h), (-0.58 * hw + b, 0.4 * h)])+ mu = self.poly(upper, smooth=True); ml = self.poly(lower, smooth=True)+ n = 0+ for m in (mu, ml):+ n += self.fill(m, rot + r.normal(0, 6), colour, length=(0.35 * w, 0.7 * w), width=(0.18 * h, 0.3 * h),+ density=2.6, pressure=0.96, dry=0.15, streak=0.2, value=0.04, smear=0.0,+ clip=self._edge_clip(m, 0.25), passes=2, seed=int(r.integers(1 << 30)))+ if parting:+ n += self.crayon(L([(-0.88 * hw, -sm * 0.9), (-0.3 * hw + b, 0.04 * h), (0.3 * hw + b, 0.04 * h),+ (0.88 * hw, -sm * 0.9)]), max(2.0, 0.11 * h), dark, pressure=0.75 * parting + 0.2,+ wobble=0.5, seg=(w, w * 2), gap=0.0, double=0.0, dry=0.3, taper=0.4,+ seed=int(r.integers(1 << 30)))+ return n++ def hair(self, region, flow, colours=('black',), n=60, length=(120, 260), width=(7, 14), bend=0.06, pressure=0.9,+ dry=0.45, taper=0.75, roots=None, clip=None, jitter=0.12, seed=None):+ """loose energetic hair strokes: n long strokes that land in `region` (or start on `roots`), follow `flow`+ (degrees, a radians field or f(x, y)) with a strong bend and thin to a point; colours are picked at random"""+ r = self._r(seed)+ M = self._mask(roots if roots is not None else region)+ bb = self._bbox(M)+ if bb is None: return 0+ x, y = self._seed_points(M, bb, n * 6, r)+ if not len(x): return 0+ sel = r.choice(len(x), min(n, len(x)), replace=False)+ x, y = x[sel], y[sel]+ m = len(x)+ L = self._sizes(length, x, y, r); Wd = self._sizes(width, x, y, r)+ k = 9+ field = self._field_rad(flow)+ if roots is not None:+ # start at the root: integrate forward only+ P = np.zeros((m, k, 2), np.float32)+ P[:, 0, 0] = x; P[:, 0, 1] = y+ st = L / (k - 1)+ jit = (jitter * r.normal(0, 1, m)).astype(np.float32)+ bd = (bend * r.normal(0, 1.2, m)).astype(np.float32)+ px, py = x.copy(), y.copy()+ for j in range(1, k):+ a = _lookup(field, px, py) + jit + bd * j+ px = px + np.cos(a) * st; py = py + np.sin(a) * st+ P[:, j, 0] = px; P[:, j, 1] = py+ else:+ P = self._centrelines(x, y, L, field, (jitter * r.normal(0, 1, m)).astype(np.float32),+ (bend * r.normal(0, 1.2, m)).astype(np.float32), k)+ cols = self._colours(list(colours) if not isinstance(colours, (str, dict)) else colours, x, y, r)+ pr = (pressure * r.uniform(0.85, 1.05, m)).astype(np.float32)+ al = np.ones(m, np.float32)+ dr = (dry * r.uniform(0.6, 1.3, m)).astype(np.float32)+ st2 = np.full(m, 0.45, np.float32)+ self._draw(P, Wd, cols, al, pr, dr, st2, taper, 0.96, 0.05, None, 0.04, clip, None, 2, 0.25, r)+ self.n_strokes += m+ return m++ # ================================================================== output+ def finish(self, tooth=1.0, relief=1.0, grain=1.0, soft=0.15):+ """record the finishing (applied in render, so every stage snapshot matches the final look; call it before+ the first mark): the tooth showing through the wax, a little waxy relief at the edges of the deposit, a+ faint grain, a very slight softening"""+ self.fin = dict(tooth=tooth, relief=relief, grain=grain, soft=soft)+ return self++ def render(self):+ """the finished picture (the canvas is untouched)"""+ C = self.C+ f = self.fin+ if not f: return np.clip(C, 0, 1)+ self._need()+ out = C.copy()+ wax = np.clip(self.F, 0, 1)+ if f['relief']:+ # a little body at the edges of the deposit (lit from the upper left); pale wax shows it least+ Hs = blur(np.minimum(self.F, 1.2), 1.5)+ gy, gx = np.gradient(Hs)+ sh = np.clip(-(LIGHT[0] * gx + LIGHT[1] * gy) * 0.5 * f['relief'], -0.05, 0.05)+ sh *= 1 - 0.75 * smoothstep(0.55, 0.92, out.mean(-1))+ out *= (1 + sh)[..., None]+ del Hs, gx, gy, sh+ if f['tooth']:+ out *= (1 + f['tooth'] * 0.07 * wax * (self.T - 0.5))[..., None]+ if f['grain']:+ out *= (1 + f['grain'] * 0.006 * self._grain)[..., None]+ if f['soft']:+ for c in range(3): out[..., c] = out[..., c] * (1 - f['soft']) + blur(out[..., c], 0.6) * f['soft']+ return np.clip(out, 0, 1)++ def composite(self):+ out = self.render()+ out *= 255; out += 0.5+ return Image.fromarray(out.astype(np.uint8))++ def stage(self, name):+ if not self.keep_stages: return+ im = self.composite()+ if self.stages_dir:+ os.makedirs(self.stages_dir, exist_ok=True)+ im.save(f'{self.stages_dir}/{self._n_stages:02d}_{name}.png', compress_level=1)+ else:+ b = io.BytesIO(); im.save(b, 'PNG', compress_level=1)+ self.stages.append((name, b.getvalue()))+ self._n_stages += 1++ def save(self, path, stages_dir=None, quality=88):+ img = self.composite()+ if str(path).lower().endswith(('.jpg', '.jpeg')): img.save(path, quality=quality, subsampling=0)+ else: img.save(path)+ sd = stages_dir or self.stages_dir+ if sd and self.keep_stages:+ os.makedirs(sd, exist_ok=True)+ for i, (name, b) in enumerate(self.stages):+ with open(f'{sd}/{i:02d}_{name}.png', 'wb') as f: f.write(b)+ img.save(f'{sd}/{self._n_stages:02d}_final.png', compress_level=1)+ return img