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 grainy picture book style (81 total): the evening walk
cloveric5f2513048c95
diff --git a/README.md b/README.mdindex 04fe4a9..1333604 100644--- a/README.md+++ b/README.md@@ -1,7 +1,7 @@# Claude Drawing · Claude 绘图-**Claude paints with code — no image model.** Eighty 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, an oil-pastel portrait of a woman warming her hands on a paper cup on a winter morning, a sketchbook doodle of a girl in a rainbow-striped jumper reading on a stool while her cat sleeps at her feet and a sheet of flat Japanese spot illustrations of a rainy Saturday with one red thing in every vignette.-**不用生图模型,Claude 用代码一笔一笔作画。** 八十种画风,从水墨、油画到黏土、蓝晒、彩色玻璃花窗、罗马马赛克、代尔夫特蓝瓷砖、赛博朋克、光线追踪的小球海、低多边形 3D、热成像、X 光片、VHS 录像带、Synthwave 落日、产品发布片式的粉彩界面、红笔批改的答题卡、油灯下的皮影戏、钢笔淡彩的速写小卡、复古水粉的绘本大头像、蓝调绘本的雨天跨页、江南园林的春水园景、干刷色块的 mid-century 海报、暮色微缩绘本里转入星空的黄昏、排线夜景里流进海里的熔岩、深色笔记应用里渲染出的流程图、卡片铺开的无限白板、Flexoki 暖纸上的五图图解、暖调彩铅叠出来的绘本跨页、挂满彩旗的水粉彩色小镇、把橘猫当围巾的色粉小像、捧着罐中小幽灵的诗意万圣夜、冬天早上捧着一杯热饮的油画棒肖像、穿彩虹条纹毛衣、坐在小凳上读书的手账线描和每幅一个红色点睛、讲一个雨天星期六的日系扁平小插画。+**Claude paints with code — no image model.** Eighty-one 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, an oil-pastel portrait of a woman warming her hands on a paper cup on a winter morning, a sketchbook doodle of a girl in a rainbow-striped jumper reading on a stool while her cat sleeps at her feet, a sheet of flat Japanese spot illustrations of a rainy Saturday with one red thing in every vignette and a grainy, chalky picture-book page of a child walking a little dog home through the snow on a cobalt evening.+**不用生图模型,Claude 用代码一笔一笔作画。** 八十一种画风,从水墨、油画到黏土、蓝晒、彩色玻璃花窗、罗马马赛克、代尔夫特蓝瓷砖、赛博朋克、光线追踪的小球海、低多边形 3D、热成像、X 光片、VHS 录像带、Synthwave 落日、产品发布片式的粉彩界面、红笔批改的答题卡、油灯下的皮影戏、钢笔淡彩的速写小卡、复古水粉的绘本大头像、蓝调绘本的雨天跨页、江南园林的春水园景、干刷色块的 mid-century 海报、暮色微缩绘本里转入星空的黄昏、排线夜景里流进海里的熔岩、深色笔记应用里渲染出的流程图、卡片铺开的无限白板、Flexoki 暖纸上的五图图解、暖调彩铅叠出来的绘本跨页、挂满彩旗的水粉彩色小镇、把橘猫当围巾的色粉小像、捧着罐中小幽灵的诗意万圣夜、冬天早上捧着一杯热饮的油画棒肖像、穿彩虹条纹毛衣、坐在小凳上读书的手账线描、每幅一个红色点睛、讲一个雨天星期六的日系扁平小插画和钴蓝雪夜里牵着小狗回家、满纸粉笔颗粒的颗粒童书。[English](#english) · [中文](#中文)@@ -62,6 +62,8 @@|  |  |  || **Sketchbook doodle · 手账线描** | **Sketchbook doodle · 手账线描(放风筝)** | **Flat spot illustration · 日系扁平小插画** ||  |  |  |+| **Grainy picture book · 颗粒童书** | **Grainy picture book · 颗粒童书(喂鸭子)** | **Watercolour · 水彩(底纹)** |+|  |  |  |### Gallery · 画廊@@ -151,8 +153,10 @@| <img src="examples/sketchbook_reading_hour.jpg" width="100%"> | <img src="examples/sketchbook_kite_day.jpg" width="100%"> || **雨天的星期六** · *A Rainy Saturday*<br><sub>Flat spot illustration · 日系扁平小插画</sub> | **雨天的星期六(宽页)** · *A Rainy Saturday, 16:9*<br><sub>Flat spot illustration · 日系扁平小插画 — the same five vignettes laid out 16:9 for explainer videos · 同样五幅小画排成讲解视频用的宽页</sub> || <img src="examples/spotillo_rainy_saturday.jpg" width="100%"> | <img src="examples/spotillo_rainy_saturday_wide.jpg" width="100%"> |+| **雪夜遛狗** · *The Evening Walk*<br><sub>Grainy picture book · 颗粒童书</sub> | **喂鸭子** · *Feeding the Ducks*<br><sub>Grainy picture book · 颗粒童书 — a 16:9 spread for explainer videos · 讲解视频用的宽页</sub> |+| <img src="examples/grainbook_snow_walk.jpg" width="100%"> | <img src="examples/grainbook_duck_pond.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, 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, a winter coat laid in with dry oil-pastel strokes that skip the paper's tooth and run out in a comb of wax, a girl's hair drawn strand by strand in hair-thin ink above a jumper striped in colour pencil that overruns its own outline, and flat shapes cut with a hand-wobbled edge, folds cut into them in white and one red thing in every vignette. 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, a winter coat laid in with dry oil-pastel strokes that skip the paper's tooth and run out in a comb of wax, a girl's hair drawn strand by strand in hair-thin ink above a jumper striped in colour pencil that overruns its own outline, flat shapes cut with a hand-wobbled edge, folds cut into them in white and one red thing in every vignette, and a snowy cobalt evening laid shape by shape with a dry, chalky brush whose colour breaks into grain and frays at every edge. 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.---@@ -160,7 +164,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 eighty styles:+A [Claude Code](https://claude.com/claude-code) skill and a small painting library with eighty-one styles:| Style | Module | What makes it read as the real medium ||---|---|---|@@ -244,6 +248,7 @@ A [Claude Code](https://claude.com/claude-code) skill and a small painting libra| **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()` || **Sketchbook doodle (手账线描)** | `lib/sketchbook.py` · `Sketchbook` | a page from an illustrator's sketchbook: warm off-white paper with a faint blush, mostly left empty, one small character and two or three sparse props floating on it — no ground, no background. The drawing is hair-thin dark ink: every line is smoothed, pushed sideways by a slow hand wobble and a tiny tremor, tapers in where the nib lands and out in a long flick, drifts in width and ink flow, and now and then lifts for a few px; `contour()` draws a closed shape as one to three strokes that leave a gap or run past each other at the joins. Lines are cut into runs of constant width and darkness, drawn by Pillow into a 4× supersampled layer and multiplied in (ink is transparent). Hair is a `hair()` lock: many separate strands interpolated between guide curves, waving in phase with their neighbours and thinning to long tips, paper showing between them. Faces are tiny: `eye_closed()` arcs with a few lashes or `eye_dot()`s, a one-stroke nose, a small red `mouth()`, two round `blush()` dots. Clothes are filled with `stripes()`: loose bands of colour pencil and marker laid along stroke coordinates (long streaks, an elongated grain, pigment catching the tooth or lying flat), each band with its own colour, width, tilt and grain, two independently wandering edges and ends that overrun the ink line or stop short of it; bands follow an angle, bow into a smile or wrap round a sleeve's centre-line, and colours multiply (red over yellow turns orange). Props are thin coloured lines: `leaf()` with herringbone vein hatching (or veins left white in the fill), `flower()`, multi-line `tree()`s, a `steam()` curl, `ticks()` for fur and grass, a tiny `squiggle()` (never fake writing) || **Flat spot illustration (日系扁平小插画)** | `lib/spotillo.py` · `SpotIllustration` | Japanese-style spot illustrations of everyday life: several small vignettes floating on white with generous space between them — no ground, no background, at most a puddle or a sliver of shadow. Every shape is one flat, opaque colour with no gradient or shading, only a faint print grain; its outline is pushed in and out by a periodic wobble before it is cut, so edges are slightly irregular, never vector-perfect. A restrained palette — navy, slate and powder blue, mustard, olive and forest green, greys, near-black hair, skin left as the paper — with one warm red that recurs as the accent in every vignette (an umbrella, a pot, a bowl, a mug, a pair of socks). Lines are few: `gap=` cuts a thin white gap round a shape so an arm reads against a sweater of the same colour, `fold()` cuts folds and seams in white into dark cloth (a shade darker on pale cloth), and thin dark lines draw only a profile, fingers and furniture legs. People are built from simple parts in a fixed back-to-front order by `person()` — a pose preset ('stand', 'walk', 'sit', 'crouch', 'reach'), joints overridden in head units, the whole figure turned to lie down, hooks to slip a prop between the layers — with paper-white faces (a profile line and a dot eye), lumpy hair blobs with white strands cut in and mitten hands with red finger lines. Little hand marks tell the action: steam squiggles, three dashes of surprise, z's, rain |+| **Grainy picture book (颗粒童书)** | `lib/grainbook.py` · `GrainBook` | the sweet, grainy mid-century children's-book look: a full-bleed page — no margin, no vignette — in a small, saturated palette (cobalt and ultramarine skies or a dusty-blue ground, vermilion and tomato red, orange, pine green, cream, peach snow, black hair). Everything is one big flat shape laid with a dry, chalky brush: `fill()` thresholds the shape's softened mask against a streak texture (made once per 7.5° of stroke direction and read at a random offset), the paper tooth and a mid-scale noise, so every edge frays into a crumbly fringe along the stroke and is a shade darker there; a pressure that falls off toward the edge skips the tooth, so the cream underlayer shows through in specks; the colour drifts lighter and darker along faint dry streaks over a sandy grain. No outlines — shapes meet colour to colour, with a few dark crayon accents (window bars, a lead, a smile). Skies are painted in steps by `bands()`, each colour dry-brushed up into the one above (`blend`), never a digital gradient; light is a lighter dry scumble, shadows are flat multiplied shapes. Sweet faces from parts — big round black-and-white eyes or dot eyes, coral cheeks, a button or triangle nose, a tiny mouth — and `child()` standing, walking or sitting on an edge, with bob, long, short or bun hair and a knitted hat; props for a red cottage with lit windows, feathery pines, small far firs, round trees, shrubs, a cup, a parcel, a paper bag, reeds, a lamp, a dog and ducks; snow, stars, a crescent moon, chimney smoke, ripples, footprints |Ask Claude to *"draw it yourself"*, *"paint this with code"*, or *"claude绘图"*, and name a style if you like. Claude then:@@ -469,6 +474,16 @@ Every style has a complete example: `python3 examples/<name>.py out.png --stages- red lines at the tip of a mitten are claws — give the fingers bumps and run the red lines back between them;- two black dots on a grey box are a face — a stove needs a worktop, a door seam and a row of small knobs;- a book standing open on a sleeper's chest is a box — lay it face down as a low solid tent.+- **Grainy picture book**: fill the page edge to edge in a small, saturated palette (cobalt, vermilion, orange, pine, cream, peach snow) and lay every shape with the dry, grainy brush — no outlines, only a few dark crayon accents; step the sky in bands that break into each other instead of a gradient. Watch for accidental reads:+ - long, hard streaks across a big sky look like rain — keep the streaks short and faint there (`streak` about 0.3);+ - coarse grain plus many specks turns the page to sandpaper — keep the tooth at about a pixel and the specks sparse, and let dry scumbles skip along the streaks (`skip`), not like salt and pepper;+ - hard band borders look like a flag — dry-brush each colour up into the band above (`blend`);+ - tidy cone-shaped firs dotted with snow are Christmas trees — vary every tier, leave gaps, show the trunk only at the foot (and keep a red hat with a white brim and bobble off the child);+ - a light path or rectangles of window light on the snow read as a beam and reflections — leave them out and use loose, slightly darker patches;+ - a dog with a long body and straight legs is a table — a short body, trotting legs, the white on the chest;+ - a raised hand with a thumb is a thumbs-up — a flat, palm-up oval;+ - a pupil that fills the eye white is a button — keep white showing round it;+ - a child in the same red as the cottage behind disappears into the wall — give the coat a contrasting colour.### Roadmap@@ -480,7 +495,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,加上一个小巧的绘图库,内置八十一种画风:| 画风 | 模块 | 为什么看起来像真的 ||---|---|---|@@ -564,6 +579,7 @@ Every style has a complete example: `python3 examples/<name>.py out.png --stages| **油画棒肖像** | `lib/oilpastel.py` · `OilPastel` | 白色糙面纸上的油画棒(蜡笔)人物小像,人浮在白纸上——不画背景,至多一抹天色或一块干刷的投影。颜色收得紧而浓:藏红花黄和金盏黄、偏青的藏青和黑、一种冷蓝,加橙色腮红和橙红嘴唇。大衣、围巾、帽子这类大块颜色用宽度不变的棒一道道平行地铺满;蜡挂在直方图均衡过的纸纹凸起上、跳过纸坑,所以每块颜色里都撒着脆的白点,顺着笔拉成短道(纸纹预先沿 8 个方向拖开)。棒用秃了的那一面分成几道,每道自己的压力、明暗和终点,所以起笔钝而饱满、收笔是一把长短不一的硬梳齿;`spill` 让笔触冲出形状,每段边冲出去的距离各不相同。黑色蜡笔(`crayon()`:抖动、分段搭接、粗细不一的线)只用在眼睛、眉毛、鼻孔和几处轮廓、衣褶上。脸就是纸,背光一侧几笔桃色,排线的橙色 `blush()`,平涂的 `lips()`,压低眼皮的黑色 `eye()`;头发是几笔收尖的长 `hair()`;针织条纹是短而粗的 `dashes()`。笔触和色粉小像同一套按段编号的 id 图。蜡下面透出来的纸纹和蜡边缘的一点厚度在 `render()` 里加 || **手账线描** | `lib/sketchbook.py` · `Sketchbook` | 速写本里的一页小画:暖米白、带一点粉的纸大片空着,一个小人物加两三件稀疏的道具浮在上面,不画地面和背景。画是发丝细的深色墨线:每根线先过样条,再沿法向推一个慢的手抖和一点快的颤,起笔细、收笔挑出一个长尖,粗细和墨色慢慢变,偶尔抬笔断开几 px;`contour()` 把闭合的形状画成一到三笔,接口留缺口或搭过头。线切成粗细和深浅都不变的几段,用 Pillow 画进 4 倍超采样的图层,再正片叠底(墨是透明的)。头发是 `hair()`:在几条导线之间插出很多根分开的细线,和相邻的线一起起伏,发梢收成长尖,线之间露着纸。脸很小:`eye_closed()` 的弧线加几根睫毛或 `eye_dot()`,一笔鼻子,小红 `mouth()`,两颗圆的 `blush()`。衣服用 `stripes()` 涂成彩铅和马克笔的松散条纹:沿笔的方向铺(长道子、顺笔的细颗粒,颜料挂在纸纹上或平平铺开),每条自己的颜色、宽度、倾斜和颗粒,上下两条边各自游移,两头冲出墨线或够不到;条纹可以按角度排、弯成微笑,也可以绕着袖子的中心线转;颜色正片叠底(红压黄成橙)。道具是细的彩色线:带人字形叶脉排线(或叶脉留白)的 `leaf()`、`flower()`、几根线叠成的 `tree()`、一缕 `steam()`、猫毛和草的 `ticks()`、一个小 `squiggle()`(不写假字) || **日系扁平小插画** | `lib/spotillo.py` · `SpotIllustration` | 日系的生活小插画(spot illustration):几幅日常小事的小画散在白纸上,中间留足白,不画地面和背景,至多一个水洼或一道小影子。每块颜色都是平涂的不透明色块,没有渐变和明暗,只有极淡的印刷颗粒;下刀前轮廓先沿法向推一个周期的起伏,所以边略不规整,不像矢量那么光。颜色克制——藏青、灰蓝和粉蓝、芥末黄、橄榄绿和墨绿、几种灰、近黑的头发,皮肤就是白纸——每幅里只有一个反复出现的暖红(伞、锅、碗、马克杯、一双袜子)。线很少:`gap=` 在一块颜色周围刻一道白缝,同色的胳膊和毛衣才分得开;`fold()` 在深色布料上刻白色的衣褶和接缝(浅色布料上画深一号的线);深色细线只画侧脸、手指和家具腿。人由 `person()` 用简单零件按从后往前的顺序拼:姿势预设(站、走、坐、蹲、伸手),以头高为单位改关节,整个人转过来就能躺下,`hooks` 在两层之间插进道具;脸是白纸加一道侧脸线和一点眼,头发是鼓包的一整块、刻两三根白发丝,手像连指手套、指缝是红线。小动作交给手画的小记号:热气的 S 形、惊讶的三短线、z、雨点 |+| **颗粒童书** | `lib/grainbook.py` · `GrainBook` | 甜美、带颗粒的 mid-century 童书味:满幅的一页,不留白、不做小像,颜色少而饱和(钴蓝和群青的天或灰蓝底、朱红和番茄红、橙、松绿、奶油色、桃粉色的雪、黑头发)。每样东西都是一大块平涂的形状,用干的粉笔颗粒笔刷铺:`fill()` 把形状的遮罩轻轻模糊后,对条纹纹理(按笔触方向每 7.5° 生成一张、从随机偏移处读)、纸齿和中尺度噪声取阈值,边缘碎成顺着笔触的毛边、那一圈颜色深一点;压力往边上掉、跳过纸齿,底下的奶油色一点点露出来;颜色顺着淡淡的干笔条纹忽深忽浅,压在细沙似的颗粒上。没有描线,形状和形状色块相接,只有几笔深色蜡笔点睛(窗格、牵绳、笑嘴)。天空由 `bands()` 一级一级画,每一层再往上干扫一段(`blend`),不用数码渐变;亮面是更浅的干笔擦扫,投影是一块平的正片叠底。甜脸用零件拼:黑白大圆眼或点点眼、珊瑚色圆腮红、扣子或三角鼻子、小嘴;`child()` 站、走或坐在边上,波波头、长发、短发或发髻,毛线帽;道具有亮灯的红色小屋、羽状松树、远处小冷杉、圆树、灌木、杯子、纸盒、纸袋、芦苇、路灯、小狗和鸭子;还有雪、星、月牙、炊烟、涟漪、脚印 |对 Claude 说「claude绘图」「你自己画」「用代码画」,也可以指定画风。它会:1. **先定构图**:层次、焦点、留白,而且画面要图解内容本身;@@ -674,6 +690,8 @@ python3 examples/oilpastel_warm_cup.py out.jpg --stages stages/ # 油画棒肖python3 examples/sketchbook_reading_hour.py out.jpg --stages stages/ # 手账线描:读书的午后python3 examples/sketchbook_kite_day.py out.jpg --stages stages/ # 手账线描:放风筝(16:9)python3 examples/spotillo_rainy_saturday.py out.jpg --stages stages/ # 日系扁平小插画:雨天的星期六(--layout wide 出 16:9)+python3 examples/grainbook_snow_walk.py out.jpg --stages stages/ # 颗粒童书:雪夜遛狗(--layout wide 出 16:9)+python3 examples/grainbook_duck_pond.py out.jpg --stages stages/ # 颗粒童书:喂鸭子(16:9)```### 作画要点(Claude 交图前逐条自查)@@ -848,6 +866,16 @@ python3 examples/spotillo_rainy_saturday.py out.jpg --stages stages/ # 日系- 手套尖上的红线是爪子——指头要有鼓包,红线从指缝往回画;- 灰盒子上两个黑点是一张脸——灶台要有台面、门缝和一排小旋钮;- 睡着的人胸口竖着一本打开的书像个盒子——书扣着放,是一个低矮的实心「人」字。+- **颗粒童书**:满幅铺满,颜色少而饱和(钴蓝、朱红、橙、松绿、奶油色、桃粉色的雪),每块形状都用干的颗粒笔刷铺——不描线,只留几笔深色蜡笔点睛;天空一级一级分层、层与层干笔交错,不用渐变。小心看错:+ - 大片天空里又长又硬的条纹像在下斜雨——天空的条纹要短、要淡(`streak` 约 0.3);+ - 颗粒加粗、斑点加多,整页就成了砂纸——纸齿保持在 1 px 左右,斑点要稀,干扫顺着条纹跳(`skip`),不要椒盐点;+ - 分层的边又直又硬像一面旗——每一层往上干扫一段(`blend`);+ - 又齐又尖、挂着雪点的松树就是圣诞树——每层枝长短不一、留几个空,树干只露底下一截(小孩也别戴红帽子配白帽檐白绒球);+ - 雪地上一条亮路、几块方形的窗光,会被看成光柱和倒影——不画,改成大块、淡的深色斑;+ - 身子长、腿直的小狗像一张桌子——身子短、对角腿小跑、白色在胸口;+ - 扬起来带拇指的手是在竖大拇指——画成掌心朝上的扁椭圆;+ - 黑眼珠填满眼白就成了两颗纽扣——眼珠四周要留白;+ - 小孩穿和身后小屋一样的红,就融进墙里——外套换一个对比色。### 计划diff --git a/SKILL.md b/SKILL.mdindex 814b694..70d416b 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(忧郁、带一点超现实的秋夜 / 万圣节绘本肖像,暗色画板上的不透明水粉加细彩铅排线,再印出来:瓷白的脸,鼻子、脸颊、眼皮和眼睛四周泛着很重的红晕(平滑的一层红加单像素的细红斑点),下眼睑一道湿红,厚眼皮半闭、往外眼角垂,小嘴不笑,体积极简;头发是一整块雕塑般的实体——刀切一样平的齐刘海、乌黑(或银白)的波波头,几乎看不见发丝,只有一道柔和的光泽;衣物是摸得着的织物:粗麻 / 毛毡帽子(一上一下交织的粗线、线间的黑孔、毛边)、粗针织围巾和手套、斜纹织出来的格子呢外套;底子暗而沉——靛蓝夜空和星星、浓密的深色叶丛;每幅只有一处发光的点睛:眼睛和衣摆尖发着暖光的床单小幽灵,暖光照亮身边的叶子、毛线和脸的下侧;满画面一层细的印刷颗粒;附带重眼皮眼、红晕、长鼻子、小嘴、光泽带、粗麻、针织、罗纹、格子呢、毛边、掌状叶和叶丛、暖光照明和光晕、小幽灵、星星等部件)、油画棒肖像 · Oil-Pastel Portrait(白色糙面纸上的油画棒 / 蜡笔干刷人物小像,人浮在白纸上、不画背景(至多一抹天色或一块干刷的黑色投影):颜色收得紧而浓——藏红花黄 / 金盏黄、偏青的藏青和黑、一种冷蓝,加橙色腮红和橙红嘴唇;毛衣、帽子、大衣、围巾这类大块颜色用一道道平行的干笔铺满,蜡只挂在纸纹的凸起上、跳过纸坑,所以每块颜色里都撒着顺着笔拉长的纸纹白点,笔触的收尾是硬的、一把长短不一的梳齿;黑色蜡笔只点在要紧处:眼睛、眉毛、鼻孔、几笔轮廓和衣褶,不勾满轮廓线;脸就是纸本身,背光一侧几笔桃色,两块排线的橙色腮红,平涂的橙红嘴唇——简化、略歪、有表情;头发是几笔松而有劲的长笔触,针织的条纹是一段段短而粗的色条;附带干笔铺色、蜡笔线、排线腮红、短色条、干刷投影、热气、黑眼睛、粗眉、嘴唇、长发丝等部件)、手账线描 · Sketchbook Doodle(速写本里的一页小画:暖米白、带一点粉的纸上大片空着,一个小小的人物加两三件稀疏的小道具浮在纸上,不画地面和背景;发丝细的深色墨线,略抖,起笔轻、收笔挑出一个细尖,轮廓一两笔画完、接口不闭合,偶尔断开;头发是一根根分开的细线,一起顺着一个方向起伏,线与线之间露着纸;脸小而简单——闭着的弧线眼加几根睫毛(或两个小黑点)、一笔鼻子、小小的红嘴、两颗圆圆的粉腮红;衣服用彩铅和马克笔涂成一道道松散的彩虹条纹(红、黄、青绿、橙、品红、蓝),条与条之间留着纸白,每条的上下边各自游移,有的冲出墨线、有的够不到,看得见彩铅的颗粒和顺笔的道子,颜色压在一起会变(红压黄成橙);道具用细的彩色线:单片叶子带人字形叶脉排线(或在填色里留白的叶脉)、小花、几根细线叠成的小树、一缕带卷的热气、一只团着睡觉的猫;附带抖线墨线、不闭合的轮廓、发丝、条纹、彩铅 / 马克笔上色、圆腮红、闭眼、点眼、小红嘴、叶子、小花、细线树、热气、短毛刺、小涂鸦等部件)、日系扁平小插画 · Flat Spot Illustration(几幅日常小事的小插画散在白纸上,中间留足白,不画地面和背景(至多一个水洼或一道小影子):每块颜色都是平涂的不透明色块,没有渐变和明暗,只有极淡的印刷颗粒,边缘略不规整、像手剪或马克笔铺出来的;颜色克制——藏青、灰蓝和粉蓝、芥末黄、橄榄绿和墨绿、几种灰、近黑的头发,皮肤就是白纸,每幅小画里只有一个反复出现的暖红(伞、锅、碗、马克杯、一双袜子);线很少:同色的两块之间留一道白缝,深色衣服上的衣褶和接缝刻成白线,浅色衣服上画深一号的线,深色细线只画侧脸、手指和家具腿;脸几乎空白,一点眼、侧脸线上一个鼻头;头发是鼓包的一整块深色,刻两三根白发丝;手像连指手套,指缝是红线;小动作交给手画的小记号:热气的 S 形、惊讶的三短线、z、雨点;附带手剪边的平涂形状、白缝、自动选色的衣褶线、用简单零件拼的人(站、走、坐、蹲、躺)和手、鞋,伞、锅、马克杯、碗、托特包、自行车、长椅、扶手椅、沙发、猫、盆栽等道具,热气、惊讶线、z、雨等记号)。用户说「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 油画棒风、手账线描、手账风、手账风插画、手账小画、手账插画、速写本插画、速写本小画、速写本的一页、线描小人、细线插画、细线手绘、发丝细的线、细墨线、童趣手绘、可爱手绘、治愈系手绘、彩虹条纹、条纹毛衣、彩虹毛衣、彩虹条纹毛衣、彩条衣服、彩铅条纹、马克笔条纹、粉腮红、圆腮红、闭着眼睛的小人、小红嘴、单片叶子、叶脉排线、细线小树、团着睡觉的猫、读书的女孩、小人物大留白、Midjourney 手账风、日系扁平小插画、日系扁平插画、扁平小插画、日系小插画、spot illustration、小插图、点缀插画、专栏插画、杂志小插画、生活小插画、日常小插画、生活方式插画、一天里的小事、日常小事、几幅小画、白底小插画、平涂色块小人、平涂插画、无描边插画、手剪边、白线衣褶、一个红色点睛、红色点睛、藏青芥末黄、空白的脸、侧脸线、一块黑头发、热气小曲线、惊讶三短线、雨天的星期六、下雨天在家、撑红伞、喂猫、午睡、看书喝茶、煮汤),或 "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 / sketchbook doodle / sketchbook illustration / whimsical hand-drawn illustration / delicate ink lines / playful colors / charming characters / beautiful sketchbook aesthetic / so simple yet full of personality / fine ink line drawing / hair drawn strand by strand / rainbow-striped sweater / striped jumper / colored-pencil stripes / marker stripes / round pink blush / closed eyes with lashes / tiny red lips / leaf with vein hatching / thin line trees / steam curl / curled-up sleeping cat / small figure on a big empty page / Midjourney sref 1970397074 look without an image model / flat spot illustration / spot illustrations / Japanese flat illustration / Japanese spot illustration / everyday life vignettes / small vignettes on white / editorial spot art / flat colour shapes / no outlines / hand-cut edges / white fold lines / one red accent / navy and mustard / powder blue / blank faces / dot eyes / black hair blob / steam squiggles / surprise marks / rainy day vignettes / slice of life illustration" 时使用;也用于需要逐步画出(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 海报仍用干刷色块,小孩在糙纸上画的蜡笔画仍用儿童蜡笔画,梵高式厚涂的风景仍用油画厚涂。「手账线描 / 手账风 / 速写本小画 / 细线墨线加彩虹条纹 / 粉腮红闭着眼的小人」指手账线描(大片空着的暖米白纸上一个小人物和两三件道具:发丝细、略抖、不闭合的墨线,一根根分开的头发,彩铅和马克笔涂的彩虹条纹衣服,圆粉腮红、闭着的眼睛、小红嘴,单片叶子和细线小树);贴纸、小票、和纸胶带的「手帐拼贴」仍用贴纸拼贴 · 小票,橡木桌上针管笔加松散淡彩的速写小卡(「速写本小人」)仍用钢笔淡彩,满画面彩铅叠涂、带天空和场景的童书页仍用暖调彩铅绘本,白纸上粗笔干刷的人物小像仍用油画棒肖像,软色粉揉开、大圆眼的角色小像仍用色粉小像,草稿纸上的蓝色圆珠笔涂鸦仍用圆珠笔涂鸦。「日系扁平小插画 / spot illustration / 几幅日常小事的小插画 / 平涂色块的小人加一个红色点睛 / 白线衣褶」指日系扁平小插画(几幅小画散在白纸上:平涂的不透明色块、手剪似的边、极淡的颗粒,藏青、粉蓝、芥末黄、橄榄绿、灰和近黑的头发,每幅只有一个红色的东西,衣褶刻成白线,脸是白纸加一道侧脸线和一点眼);分层几何色块、层间投影的风景和夜景仍用扁平矢量,发丝细墨线加彩虹条纹、一个小人物占一页的仍用手账线描,针管笔线稿加淡彩的速写小卡仍用钢笔淡彩,米白纸上几大块干刷色的 mid-century 海报仍用干刷色块,白纸上粗笔干刷的人物小像仍用油画棒肖像,产品发布片的界面仍用粉彩界面。+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(白色糙面纸上的油画棒 / 蜡笔干刷人物小像,人浮在白纸上、不画背景(至多一抹天色或一块干刷的黑色投影):颜色收得紧而浓——藏红花黄 / 金盏黄、偏青的藏青和黑、一种冷蓝,加橙色腮红和橙红嘴唇;毛衣、帽子、大衣、围巾这类大块颜色用一道道平行的干笔铺满,蜡只挂在纸纹的凸起上、跳过纸坑,所以每块颜色里都撒着顺着笔拉长的纸纹白点,笔触的收尾是硬的、一把长短不一的梳齿;黑色蜡笔只点在要紧处:眼睛、眉毛、鼻孔、几笔轮廓和衣褶,不勾满轮廓线;脸就是纸本身,背光一侧几笔桃色,两块排线的橙色腮红,平涂的橙红嘴唇——简化、略歪、有表情;头发是几笔松而有劲的长笔触,针织的条纹是一段段短而粗的色条;附带干笔铺色、蜡笔线、排线腮红、短色条、干刷投影、热气、黑眼睛、粗眉、嘴唇、长发丝等部件)、手账线描 · Sketchbook Doodle(速写本里的一页小画:暖米白、带一点粉的纸上大片空着,一个小小的人物加两三件稀疏的小道具浮在纸上,不画地面和背景;发丝细的深色墨线,略抖,起笔轻、收笔挑出一个细尖,轮廓一两笔画完、接口不闭合,偶尔断开;头发是一根根分开的细线,一起顺着一个方向起伏,线与线之间露着纸;脸小而简单——闭着的弧线眼加几根睫毛(或两个小黑点)、一笔鼻子、小小的红嘴、两颗圆圆的粉腮红;衣服用彩铅和马克笔涂成一道道松散的彩虹条纹(红、黄、青绿、橙、品红、蓝),条与条之间留着纸白,每条的上下边各自游移,有的冲出墨线、有的够不到,看得见彩铅的颗粒和顺笔的道子,颜色压在一起会变(红压黄成橙);道具用细的彩色线:单片叶子带人字形叶脉排线(或在填色里留白的叶脉)、小花、几根细线叠成的小树、一缕带卷的热气、一只团着睡觉的猫;附带抖线墨线、不闭合的轮廓、发丝、条纹、彩铅 / 马克笔上色、圆腮红、闭眼、点眼、小红嘴、叶子、小花、细线树、热气、短毛刺、小涂鸦等部件)、日系扁平小插画 · Flat Spot Illustration(几幅日常小事的小插画散在白纸上,中间留足白,不画地面和背景(至多一个水洼或一道小影子):每块颜色都是平涂的不透明色块,没有渐变和明暗,只有极淡的印刷颗粒,边缘略不规整、像手剪或马克笔铺出来的;颜色克制——藏青、灰蓝和粉蓝、芥末黄、橄榄绿和墨绿、几种灰、近黑的头发,皮肤就是白纸,每幅小画里只有一个反复出现的暖红(伞、锅、碗、马克杯、一双袜子);线很少:同色的两块之间留一道白缝,深色衣服上的衣褶和接缝刻成白线,浅色衣服上画深一号的线,深色细线只画侧脸、手指和家具腿;脸几乎空白,一点眼、侧脸线上一个鼻头;头发是鼓包的一整块深色,刻两三根白发丝;手像连指手套,指缝是红线;小动作交给手画的小记号:热气的 S 形、惊讶的三短线、z、雨点;附带手剪边的平涂形状、白缝、自动选色的衣褶线、用简单零件拼的人(站、走、坐、蹲、躺)和手、鞋,伞、锅、马克杯、碗、托特包、自行车、长椅、扶手椅、沙发、猫、盆栽等道具,热气、惊讶线、z、雨等记号)、颗粒童书 · Grainy Picture Book(满幅不留白的 mid-century 童书页,颜色少而饱和:钴蓝 / 群青的夜空或灰蓝底、朱红 / 番茄红、橙、松绿、奶油色、桃粉色的雪和黑头发;每样东西都是一大块平涂的形状,用干的、粉笔似的颗粒笔刷铺出来——颜色碎成细沙似的颗粒和深浅小点,顺着笔触有淡淡的干笔条纹,偶尔跳过纸齿露出底下的奶油底色,边缘是干笔扫出来的毛茸茸的碎边;没有描线,形状和形状色块相接,只有几笔深色蜡笔点睛(窗格、牵绳、笑嘴);亮面是一侧更浅的干笔擦扫,投影是压在上面的一块平的深色;脸简单而甜:黑白大圆眼或点点眼、珊瑚色圆腮红、小嘴、扣子或三角鼻子;天空一级一级分层、层与层之间干笔交错,不用数码渐变;附带干颗粒填色、干笔擦扫、分层天空、斑块、投影、光圈、干笔和蜡笔点睛线、颗粒小点,甜脸零件、波波头 / 长发 / 短发 / 发髻、毛线帽,站 / 走 / 坐的小孩,亮灯的红色小屋、羽状松树、远处小冷杉、圆树、灌木、松枝丛、杯子、纸盒、纸袋、盆栽、芦苇、草丛、路灯、小狗、鸭子、栅栏,雪、星、月牙、炊烟、热气、涟漪、脚印)。用户说「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 油画棒风、手账线描、手账风、手账风插画、手账小画、手账插画、速写本插画、速写本小画、速写本的一页、线描小人、细线插画、细线手绘、发丝细的线、细墨线、童趣手绘、可爱手绘、治愈系手绘、彩虹条纹、条纹毛衣、彩虹毛衣、彩虹条纹毛衣、彩条衣服、彩铅条纹、马克笔条纹、粉腮红、圆腮红、闭着眼睛的小人、小红嘴、单片叶子、叶脉排线、细线小树、团着睡觉的猫、读书的女孩、小人物大留白、Midjourney 手账风、日系扁平小插画、日系扁平插画、扁平小插画、日系小插画、spot illustration、小插图、点缀插画、专栏插画、杂志小插画、生活小插画、日常小插画、生活方式插画、一天里的小事、日常小事、几幅小画、白底小插画、平涂色块小人、平涂插画、无描边插画、手剪边、白线衣褶、一个红色点睛、红色点睛、藏青芥末黄、空白的脸、侧脸线、一块黑头发、热气小曲线、惊讶三短线、雨天的星期六、下雨天在家、撑红伞、喂猫、午睡、看书喝茶、煮汤、颗粒童书、颗粒绘本、颗粒质感童书、颗粒质感插画、粉笔质感插画、粉笔颗粒、干笔颗粒、颗粒笔刷、甜美童书插画、甜美绘本、Midjourney 童书风、mid-century 童书、复古童书插画、满幅绘本页、满版童书插画、无描边童书、钴蓝夜空、群青夜空、钴蓝加朱红、雪夜小屋、红房子雪夜、桃粉色的雪、雪点、黑白大眼睛、点点眼、圆腮红、三角鼻子、羽状松树、遛狗、雪夜遛狗、喂鸭子、黄昏池塘、码头),或 "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 / sketchbook doodle / sketchbook illustration / whimsical hand-drawn illustration / delicate ink lines / playful colors / charming characters / beautiful sketchbook aesthetic / so simple yet full of personality / fine ink line drawing / hair drawn strand by strand / rainbow-striped sweater / striped jumper / colored-pencil stripes / marker stripes / round pink blush / closed eyes with lashes / tiny red lips / leaf with vein hatching / thin line trees / steam curl / curled-up sleeping cat / small figure on a big empty page / Midjourney sref 1970397074 look without an image model / flat spot illustration / spot illustrations / Japanese flat illustration / Japanese spot illustration / everyday life vignettes / small vignettes on white / editorial spot art / flat colour shapes / no outlines / hand-cut edges / white fold lines / one red accent / navy and mustard / powder blue / blank faces / dot eyes / black hair blob / steam squiggles / surprise marks / rainy day vignettes / slice of life illustration / grainy picture book / grainy children's book illustration / sweet children's book illustration / chalky grain / dry grainy brush / grain texture illustration / mid-century children's book / full-bleed picture book page / cobalt and vermilion / cobalt night sky / red cottage in the snow / peach snow / falling snow dots / big round eyes / dot eyes and rosy cheeks / feathery pines / walking the dog / feeding the ducks / children's book moodboard" 时使用;也用于需要逐步画出(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 海报仍用干刷色块,小孩在糙纸上画的蜡笔画仍用儿童蜡笔画,梵高式厚涂的风景仍用油画厚涂。「手账线描 / 手账风 / 速写本小画 / 细线墨线加彩虹条纹 / 粉腮红闭着眼的小人」指手账线描(大片空着的暖米白纸上一个小人物和两三件道具:发丝细、略抖、不闭合的墨线,一根根分开的头发,彩铅和马克笔涂的彩虹条纹衣服,圆粉腮红、闭着的眼睛、小红嘴,单片叶子和细线小树);贴纸、小票、和纸胶带的「手帐拼贴」仍用贴纸拼贴 · 小票,橡木桌上针管笔加松散淡彩的速写小卡(「速写本小人」)仍用钢笔淡彩,满画面彩铅叠涂、带天空和场景的童书页仍用暖调彩铅绘本,白纸上粗笔干刷的人物小像仍用油画棒肖像,软色粉揉开、大圆眼的角色小像仍用色粉小像,草稿纸上的蓝色圆珠笔涂鸦仍用圆珠笔涂鸦。「日系扁平小插画 / spot illustration / 几幅日常小事的小插画 / 平涂色块的小人加一个红色点睛 / 白线衣褶」指日系扁平小插画(几幅小画散在白纸上:平涂的不透明色块、手剪似的边、极淡的颗粒,藏青、粉蓝、芥末黄、橄榄绿、灰和近黑的头发,每幅只有一个红色的东西,衣褶刻成白线,脸是白纸加一道侧脸线和一点眼);分层几何色块、层间投影的风景和夜景仍用扁平矢量,发丝细墨线加彩虹条纹、一个小人物占一页的仍用手账线描,针管笔线稿加淡彩的速写小卡仍用钢笔淡彩,米白纸上几大块干刷色的 mid-century 海报仍用干刷色块,白纸上粗笔干刷的人物小像仍用油画棒肖像,产品发布片的界面仍用粉彩界面。「颗粒童书 / 颗粒绘本 / 甜美童书插画 / 粉笔颗粒质感 / 钴蓝夜空加红房子」指颗粒童书(满幅的 mid-century 童书页:钴蓝和群青的天、朱红、橙、松绿、奶油色和桃粉色的雪,大块平涂的形状用干的粉笔颗粒笔刷铺,碎边、细颗粒和干笔条纹,没有描线,黑白大圆眼或点点眼加圆腮红);软蓝限色、乱线墨线的绘本跨页仍用蓝调绘本,白纸上不画背景、粗笔干刷的人物小像仍用油画棒肖像,背后刷一块单色、看得见毛衣针脚的复古童书大头像仍用复古水粉,粉彩黄昏转入星空的微缩风景仍用暮色微缩绘本,满画面彩铅叠涂的暖调童书页仍用暖调彩铅绘本,白纸上散着几幅平涂小画的仍用日系扁平小插画,米白纸上几大块干刷色的 mid-century 海报仍用干刷色块。---# Claude 绘图@@ -94,6 +94,7 @@ description: Claude 绘图 / Claude Drawing —— 不借助任何生图模型| 油画棒肖像 · Oil-Pastel Portrait | `lib/oilpastel.py` · `OilPastel` | `examples/oilpastel_warm_cup.py` 捧着一杯热的 · Something Warm to Hold(1600×1600 的白纸人物小像,油画棒干刷:冬天早上的露天市集,一个年轻女人把黑头发松松地挽成一个髻,双手捧着一个纸杯举到胸前,低头看着它,热气从杯口卷上来、飘过她的脸边;脸颊、鼻尖和耳朵冻得发红(两块排线的橙色腮红、一点橙红的鼻尖),平涂的橙红嘴唇,压低的厚眼皮下一对黑眼睛;藏红花黄的粗针织围巾在脖子上绕两圈、围到下巴,一头垂在胸前,上面是一段段藏青的短色条,末端一排流苏;藏青大衣用一道道长的平行干笔铺满,满是顺着笔拉长的纸纹白点,下摆一道道收成长短不一的梳齿;冷蓝的露指针织手套,一只手的四根手指绕在牛皮纸杯套前面,另一只手的拇指搭在上面,黑色塑料杯盖;没有背景,人浮在白纸上;照油画棒画家的顺序画:白纸 → 大衣和袖子 → 围巾 → 头发 → 肤色(背光一侧的桃色、脖子、耳朵、手指)→ 杯子和手套 → 条纹和罗纹 → 黑色蜡笔的点睛 → 五官 → 热气和最后几笔飞出来的头发;`--stages` 出 9 个阶段加成品) | 约 6 秒 || 手账线描 · Sketchbook Doodle | `lib/sketchbook.py` · `Sketchbook` | `examples/sketchbook_reading_hour.py` 读书的午后 · The Reading Hour(1600×1600 的速写本一页,大片暖米白纸空着,画都在下半部:一个女孩坐在小木凳上读书,双手把书举在胸前,低着头、闭着眼,读得入了神;中分的黑色长发一根根垂过肩膀,一侧别着一朵橙色小雏菊发夹;彩虹条纹毛衣(红、黄、青绿、橙、品红、蓝,条与条之间留着纸白,袖子上的条纹绕着胳膊转,有的冲出墨线、有的够不到),红色罗纹领口、芥末黄袖口;书是青绿色封面,上面画着一个小太阳,手指搭在封面边上,书拿得有点歪;蓝色百褶裙,白袜子、红鞋,一只脚垂得高一点、两只脚尖朝里;她的灰色虎斑猫在旁边地上团成一团睡着,旁边一杯冒热气的马克杯,热气一直卷到空白的纸上;另一边一盆植物伸出几片叶子(一片只用墨线画出人字形叶脉、一片蓝色的叶脉留白)和一个红花苞;右上方飘下一片黄叶;不画地面和背景;照速写本插画的顺序:空纸 → 细墨线线稿(脸、脖子、毛衣和袖子、书和手指、裙子、腿、鞋、后面的凳子)→ 一根根的头发 → 彩铅 / 马克笔的条纹 → 其他颜色(裙子、领口袖口、书皮、鞋、凳子)→ 猫 → 植物 → 马克杯和热气 → 脸(闭眼、鼻子、腮红、小嘴)→ 飘落的叶子和一个小涂鸦;`--stages` 出 9 个阶段加成品);`examples/sketchbook_kite_day.py` 放风筝 · Kite Day(1920×1080 的宽页,给讲解片用:一个穿条纹上衣、芥末黄短裤的小男孩站在空白页的左边,一只胳膊举着线轴,仰着头冲他的风筝笑;风筝飞在右上方,是红、黄、青绿、蓝四块的菱形,拖着一条挂着小蝴蝶结的长尾巴,一根发丝细的风筝线横穿整页;他身后两棵红线和绿线画的细树(绿的那棵点着粉色花苞),右边远处一棵小黄树,几丛草,两片叶子被风吹着走,两道轻轻的风;`--stages` 出 8 个阶段加成品) | 约 2.4 秒 / 约 1.4 秒 || 日系扁平小插画 · Flat Spot Illustration | `lib/spotillo.py` · `SpotIllustration` | `examples/spotillo_rainy_saturday.py` 雨天的星期六 · A Rainy Saturday(1500×2000 的白纸上散着五幅小画,讲两个人下雨的星期六:一个人撑着红伞出门,托特包里探出一根大葱和一截法棍,一脚踩进水洼溅起几道水花,伞外斜斜地下着雨;一个人系着米色围裙,在橱柜台面上用木勺搅一锅红珐琅锅里的汤,三缕热气卷上来;沙发上午睡,红袜子搭在扶手边,一本书扣在胸口,z z,黑猫在沙发前团成一团也睡着;一个人蹲下来把一碗猫粮放到地上,黑猫刚发现,头顶三道惊讶的短线;一个人窝在橄榄绿的扶手椅里低头看书,小凳上一只红马克杯冒着热气;每幅一个红色的东西(伞、锅、袜子、碗、马克杯),平涂色块、手剪似的边、白线刻出的衣褶和同色之间的白缝,脸是白纸加侧脸线和一点眼;一幅一幅画,最后统一加雨、热气、惊讶线和 z;`--layout wide` 把同样五幅排成 1920×1080(动图和画廊的宽页用),`--stages` 出空纸和五幅小画 6 个阶段加成品) | 约 1 秒 |+| 颗粒童书 · Grainy Picture Book | `lib/grainbook.py` · `GrainBook` | `examples/grainbook_snow_walk.py` 雪夜遛狗 · The Evening Walk(1600×2000 的满幅童书竖页:下雪的晚上,天从顶上的深藏青一级一级亮到山边的亮钴蓝,层与层之间干笔交错,一弯奶油色的月牙,雪点飘着;坡上一座朱红小屋,屋顶积着桃粉色的雪,窗里亮着黄灯、窗格是两道棕色蜡笔,烟囱冒出三团粉笔似的淡烟,小屋两边和画面两侧是羽状的野松,远处山脊上一排小冷杉;前面桃粉色的雪地上,一个戴芥末黄毛线帽、围红围巾、穿亮蓝外套的小孩牵着一只姜黄色的小狗往家走,红牵绳垂成一道弧,身后一串脚印,脚下一块平的淡紫投影,两个下角是几丛松枝;每块颜色都是干的颗粒笔刷铺出来的,碎边、细沙颗粒、顺笔的干条纹,没有描线;`--layout wide` 把同一页排成 1920×1080(动图用),`--stages` 出空页、天、山脊、小屋和松树、雪地、小孩、小狗、牵绳 8 个阶段加成品);`examples/grainbook_duck_pond.py` 喂鸭子 · Feeding the Ducks(1920×1080 的黄昏跨页:天从钴蓝经过一道浅色转成杏色和橙色,番茄红的太阳落到对岸的深色树后面,在水面上碎成一道道橙色的短笔;左边一条木码头伸进灰蓝的池塘,一个黑长发、黑白大圆眼、圆腮红的小女孩坐在码头尽头,两条腿悬在水上,身边一个牛皮纸袋,手一扬撒出一串面包屑;三只鸭子朝她游过来,身后荡开几道涟漪;右下角睡莲叶和芦苇,天上两只归鸟) | 约 10 秒 / 5 秒 |各画风共用 `lib/core.py` 里的底层工具:噪声、模糊、样条曲线、多边形遮罩、有机轮廓 `blob_pts`、毛笔 `bristle_stroke`、中文字体查找;新四种还用到补零平移 `shift`、文字遮罩 `text_mask`、西文字体查找 `latin_font`/`load_font`,以及高度图打光 `height_normals`、`height_shadow`(沿光线步进的投影)、`ambient_occlusion`。@@ -177,7 +178,8 @@ description: Claude 绘图 / Claude Drawing —— 不借助任何生图模型- 秋天和万圣节的夜晚、忧郁又有点超现实的一刻:一个苍白的孩子或年轻人独自站在夜里,手里捧着一点光或一个发光的小东西,身边有几个发光的小幽灵,要一眼就是「诗意的万圣节绘本」——瓷白的脸上一圈红晕、半闭的厚眼皮、刀切的黑色波波头,摸得着的粗麻帽子、粗针织围巾、格子呢外套,暗沉的靛蓝夜空和深色叶丛里只有一处暖光,讲解片里「孤独 / 守护 / 秋天 / 夜晚」的页,万圣节海报、头像和小红书封面 → 诗意万圣夜(要白纸上不画背景、粉粉的温柔角色小像用色粉小像;要背后刷一块单色、看得见毛衣针脚的复古童书大头像用复古水粉;要深蓝夜色里只有一个暖光、满画面短排线的小版画用排线夜景;要粉彩黄昏转入星空、满坡小野花的微缩风景用暮色微缩绘本;要满画面彩铅叠涂、温暖治愈的黄昏童书页用暖调彩铅绘本);- 一个人的小像或半身像(街上的路人、冬天捧着热饮的人、戴帽子的姑娘、「一个人在做一件小事」),人设卡、头像和小红书封面,要一眼就是「手画的油画棒 / 蜡笔干刷」——白纸上不画背景,颜色收得紧而浓(藏红花黄、藏青、黑、一种冷蓝,橙色腮红、橙红嘴唇),大块颜色用粗笔一道道铺满、露着纸纹白点,笔触收尾干而硬,黑色蜡笔只点在眼睛和几处轮廓,脸简化、略歪、有表情,讲解片里「这个人 / 用户画像 / 一个普通人的一刻」的页 → 油画棒肖像(要柔和粉粉、揉开的色粉加一个小动物用色粉小像;要米白纸上几大块色、背后一块滚筒色板的 mid-century 海报用干刷色块;要背后刷一块单色、看得见毛衣针脚的复古童书大头像用复古水粉;要小孩画的蜡笔画用儿童蜡笔画;要梵高式的厚涂漩涡用油画厚涂);- 一个小人物的小日常(读书、喝茶、浇花、撸猫、放风筝,「一个人慢慢地做一件小事」),手账、日记和读书笔记的配图,小红书封面和头像,讲解片里「轻松的小场景 / 生活方式 / 慢下来」的页,要一眼就是「手账风 / 速写本里的小画」——大片空着的暖米白纸,发丝细、略抖、不闭合的墨线,一根根分开的头发,彩铅马克笔涂的彩虹条纹衣服,圆圆的粉腮红、闭着的眼睛和小红嘴,道具只有两三件(单片叶子、小花、细线小树、一缕热气、团着睡觉的猫) → 手账线描(要橡木桌上的速写小卡、针管笔加松散淡彩、搞笑的街坊用钢笔淡彩;要满画面彩铅叠涂、天空和场景俱全的温暖童书页用暖调彩铅绘本;要软蓝限色、乱线墨线的绘本跨页用蓝调绘本;要白纸上粗笔干刷的人物小像用油画棒肖像;要软色粉揉开、大圆眼的角色小像用色粉小像;要小孩画的蜡笔画用儿童蜡笔画;要草稿纸上的圆珠笔涂鸦用圆珠笔涂鸦);-- 几件日常小事排在一张白纸上(喝一杯热的、下雨天出门、煮汤、喂猫、看书、午睡、骑车、做饭),杂志 / 书籍内页和专栏的小插图(spot illustration),生活方式和「一天里的几个瞬间」,讲解片里「几个使用场景 / 一组小习惯 / 生活的几个片段」的页,要一眼就是「日系扁平小插画」——几幅小画散在白纸上、不画地面和背景,每块颜色都是平涂的不透明色块,边缘略不规整,颜色克制(藏青、灰蓝和粉蓝、芥末黄、橄榄绿和墨绿、几种灰、近黑的头发),每幅里只有一个红色的东西,衣褶用白线刻进颜色里,线很少,脸几乎空白(一点眼、一道侧脸线) → 日系扁平小插画(要分层几何色块、层间投影的风景和夜景用扁平矢量;要发丝细的墨线加彩铅条纹、一个小人物占一页用手账线描;要针管笔线稿加淡彩、搞笑的街坊速写小卡用钢笔淡彩;要米白纸上几大块干刷色、背后一块色板的 mid-century 海报用干刷色块;要白纸上粗笔干刷的人物小像用油画棒肖像;要产品发布片的界面页用粉彩界面)。+- 几件日常小事排在一张白纸上(喝一杯热的、下雨天出门、煮汤、喂猫、看书、午睡、骑车、做饭),杂志 / 书籍内页和专栏的小插图(spot illustration),生活方式和「一天里的几个瞬间」,讲解片里「几个使用场景 / 一组小习惯 / 生活的几个片段」的页,要一眼就是「日系扁平小插画」——几幅小画散在白纸上、不画地面和背景,每块颜色都是平涂的不透明色块,边缘略不规整,颜色克制(藏青、灰蓝和粉蓝、芥末黄、橄榄绿和墨绿、几种灰、近黑的头发),每幅里只有一个红色的东西,衣褶用白线刻进颜色里,线很少,脸几乎空白(一点眼、一道侧脸线) → 日系扁平小插画(要分层几何色块、层间投影的风景和夜景用扁平矢量;要发丝细的墨线加彩铅条纹、一个小人物占一页用手账线描;要针管笔线稿加淡彩、搞笑的街坊速写小卡用钢笔淡彩;要米白纸上几大块干刷色、背后一块色板的 mid-century 海报用干刷色块;要白纸上粗笔干刷的人物小像用油画棒肖像;要产品发布片的界面页用粉彩界面);+- 温暖、甜、像翻开一本 mid-century 童书的一页:一个小孩和一只小动物的一件小事(牵着小狗回家、喂鸭子、捧一杯热的、雪地里走一走),冬夜和黄昏、下雪的小镇、亮灯的小屋、池塘和松林,童书封面和内页、贺卡和海报、小红书封面,讲解片里「温暖的一幕 / 回家 / 小小的日常」的满幅画面,要一眼就是「颗粒质感的甜美童书插画」——满幅不留白,颜色少而饱和(钴蓝 / 群青、朱红、橙、松绿、奶油色、桃粉色的雪),大块平涂的形状用干的粉笔颗粒笔刷铺出来,碎边和细沙颗粒,没有描线,脸是黑白大圆眼或点点眼加圆腮红 → 颗粒童书(要软蓝限色、乱线墨线的绘本跨页用蓝调绘本;要白纸上不画背景、油画棒干刷的人物小像用油画棒肖像;要单人大头像、看得见毛衣针脚用复古水粉;要粉彩黄昏转入星空、满坡野花用暮色微缩绘本;要满画面彩铅叠涂的暖光童书页用暖调彩铅绘本;要白纸上散着几幅平涂小画用日系扁平小插画;要米白纸上几大块干刷色的 mid-century 海报用干刷色块)。每种画风一幅范例作为质量基准(范例都不用禅意主题);水墨另加一幅「月印万川」(留白托月、水面倒影)。@@ -1413,6 +1415,25 @@ from core import spline, curve, blob_pts, fbm1d, blur, polygon_mask- 颜色用 `PAINTS` 里的名字(paper white ink line black;navy_deep navy blue slate powder powder_light;mustard mustard_light olive green sage;grey_light grey grey_mid grey_dark cream skin wood wood_light;red red_deep red_line pink)或 '#rrggbb'。- 范例的每幅小画是一个函数 `f(s, x, y, u)`(原点在地面、u 是头高),所以同样五幅可以排成竖幅(`--layout sheet`,1500×2000)或 16:9(`--layout wide`,1920×1080);雨、热气、惊讶线和 z 先收进 `MARKS`,五幅都画完再统一加。+**颗粒童书 `GrainBook`**:+- 思路:照 Midjourney 上那类「甜美童书插画」的做法:满幅的一页,先铺一层奶油色的底,再从后往前一大块一大块地铺颜色(天 → 远山 → 小屋和树 → 雪地 → 人物 → 动物 → 点睛线 → 飘雪),每块颜色都是一次「干的粉笔颗粒笔刷」填色;没有描线,形状和形状色块相接,只有几笔深色蜡笔点睛;亮面是一侧更浅的干笔擦扫,投影是压在上面的一块平的深色。+ - 纹理:每页一次算好共用的纹理——纸齿 `T`(直方图近似均衡、uint8)、颗粒 `G`(像素噪声加约 1 px 成团的一层)、边缘游走的中尺度噪声、大斑驳、斑点图;笔触方向的条纹纹理按 7.5° 一档、用到才生成并缓存:在格子很细长的随机网格上(约 26 × 3.6、11 × 1.6、80 × 13 px × k)双三次放大,每格变成一道条纹,三层叠加后转到笔触角度,存成比画面大的 uint8 方块,每次填色从随机偏移处读,所以同一个角度的两块颜色条纹不重样。+ - 形状:`Region` 是包围盒大小的浮点遮罩加偏移(小形状只占小数组),Pillow 2 倍超采样填多边形再平均回来;`|` 并、`&` 交、`-` 挖掉。+ - 填色 `fill()`:在加了边的包围盒里,遮罩轻轻模糊后对「条纹 + 纸齿 + 中尺度噪声」取阈值,边缘碎成顺着笔触的毛边(笔头笔尾出须、顺笔的边起伏),碎边那一圈颜色深一点(`rim`);压力从里往边上掉(`dry`,`dry_px` 是范围),和纸齿 / 条纹的混合(`skip` 是条纹的比重)比,颜色在里面零星跳过、在边上变薄,露出底下那层;颜色本身在亮条纹上偏向浅一点的 `hi`、暗条纹上偏向深一点的 `lo`(`streak`),再加细颗粒和大斑驳。不透明:新 = 旧 + A ×(颜色 − 旧);`mode='multiply'` 是压在上面的投影,`'screen'` 是光。+ - 天和地:`bands()` 一级一级分层上色,层边是起伏的干笔毛边,每一层的颜色再往上干扫一段(`blend`),所以是画出来的分层、不是数码渐变;`mottle()` 一片片松散的第二种颜色;`scumble()` 低压力、顺着条纹跳的干笔擦扫(亮面、屋顶的雪、雪地上的浅色);`shadow()` 一块平的正片叠底投影;`glow()` 两级干边的滤色光圈。+ - 线:`brush()` 一笔两头收尖的干笔(沿自己的方向填);`crayon()` 深色蜡笔点睛:路径微抖、粗细起伏、被纸齿打断;`dots()` 毛茸茸的颗粒小点(雪、星、面包屑)。+ - 收尾:`finish()` 只记参数、在 render 里加(每张阶段快照都和成品一致,要在画第一笔之前调用):整页细颗粒、稀疏的深浅斑点(深色上多亮点、浅色上多暗点)、极轻的柔化。+- 构造:`GrainBook(W, H, seed, keep_stages=True, stages_dir=None)`,先 `finish()` 再 `paper(tone)`。坐标是画面像素,角度 0° 向右、90° 向下;`k` = min(W, H) / 1000,缩放默认宽度和纹理尺度。+- 形状:`poly(pts, smooth)`、`ellipse(cx, cy, rx, ry, rot)`、`blob(cx, cy, rx, ry, rough, rot, seed)`、`rect(x0, y0, x1, y1)`、`tube(path, w0, w1, taper)`、`below(xs, ys)` / `above(xs, ys)`(曲线以下 / 以上)、`full()`,都返回 `Region`;`wavy(x0, x1, y, amp, period, seed, slope)` 给一条起伏的地平线 `(xs, ys)`。+- 上色:`fill(region, colour, angle, streak, grain, mottle, pressure, dry, edge, soft, hi, lo, alpha, clip, avoid, mode, seed, dry_px, rim, skip)`;`scumble(region, colour, angle, cover)`;`shadow(region, colour, depth, angle)`;`glow(region, colour, strength)`;`bands(region, colours, ys, angle, wave, period, blend)`;`mottle(region, colour, scale, cover, angle)`;`brush(path, width, colour, taper)`;`crayon(path, width, colour, pressure, taper, wobble)`;`dots(pts, r, colour)`。+- 脸:`face(cx, cy, r, turn, eyes, look, skin, cheeks, mouth, nose, brows, ears, eye_size)` 返回头、下巴、眼、鼻、嘴的位置(`eyes` 取 'big' 'dot' 'closed');`eye_big(cx, cy, w, h, look, highlight, lid)`、`eye_dot(cx, cy, r)`、`cheek(cx, cy, r)`、`nose(cx, cy, size, kind)`('button' 'tri' 'line' 'dot')、`mouth(cx, cy, w, kind)`('smile' 'lips' 'o' 'open')、`brow(cx, cy, w, tilt)`;`hair(cx, cy, r, style, colour, turn, layer, length)`('bob' 'long' 'short' 'bun',`layer` 先 'back' 后 'front');`beanie(cx, cy, r, colour, band, pompom, turn)`。+- 人:`limb(path, w0, w1, colour)`、`mitten(x, y, r, colour, angle, thumb)`、`boot(x, y, w, colour, facing)`;`child(x, y, h, facing, pose, outfit, hooks, **joints)` 画一个约 h 高的小孩(`pose` 取 'stand' 'walk',原点在两脚之间的地面;'sit' 原点在臀下的座沿,腿悬着),`outfit` 给 coat sleeve legs boots hair hair_style hair_len hat hat_band scarf mittens skin eyes eye_size mouth nose turn look collar buttons brows,`hooks` 在 'behind' 'hand_far' 'before_head' 'hand_near' 'end' 插东西,关节可以按 h 为单位改,返回关节(含 `face` 的各点)。+- 道具:`house(x, y, w, h, wall, side, roof, snow, depth, window, door, chimney)`(返回屋脊、烟囱口、窗)、`pine(x, y, h, w, colour, light, snow, lean)`、`fir_far(x, y, h, w, colour)`、`round_tree(x, y, h, w, crown, light, trunk)`、`bush(x, y, w, h, colour, light)`、`shrub(x, y, h, w, colour, light, snow)`、`cup(x, y, w, colour, inside, rim, handle, light, steam)`、`parcel(x, y, w, h, colour, top, string, bow)`、`bag(x, y, w, h, colour)`、`potted(x, y, h, pot, leaf)`、`reeds(x, y, h, n, colour, head, spread)`、`tuft(x, y, w, h, colour)`、`lamp(x, y, h, colour, light, glow)`、`dog(x, y, s, facing, colour, patch, ear, collar)`(返回项圈、鼻子、头)、`duck(x, y, s, facing, colour, wing, beak)`、`fence(x0, x1, y, h, colour)`。+- 天和小记号:`snow(x0, y0, x1, y1, n, r, colour, alpha, avoid)`、`stars(x0, y0, x1, y1, n, colour)`、`moon(x, y, r, colour, halo, crescent)`、`smoke(x, y, h, colour, n, drift, alpha)`、`wisp(x, y, h, colour)`、`ripples(x, y, w, n, colour)`、`footprints(pts, size, colour, depth)`。+- 收尾:`finish(grain, speckle, soft)`;`render()`、`composite()`、`stage(name)`、`save(path, stages_dir)`;`save('x.jpg')` 默认 quality 92、4:4:4 色度。+- 颜色用 `PAINTS` 里的名字(paper cream white cream_dark;navy cobalt_deep cobalt cobalt_bright ultramarine sky_pale dusty dusty_light dusty_dark teal ice;vermilion tomato red_deep brick orange orange_light apricot;pine pine_mid green moss olive sage;mustard window lamp gold;snow snow_light snow_shade snow_blue;skin skin_shade cheek nose lip;hair black ink brown brown_light wood wood_dark kraft coffee shadow shadow_blue)或 '#rrggbb'。+- 雪夜遛狗把所有位置收在 `LAYOUTS` 里,同一个 `scene()` 画竖页(`--layout page`,1600×2000)或 16:9(`--layout wide`,1920×1080);飘雪 `avoid=` 小孩的脸,雪点不落在眼睛上。+**顺序**:都是先远后近、先大后小,文字最后叠加。水墨的雾要画在它该吞没的东西之后;水彩的叶梗要先画,并且只画在叶子外面。## 三、毛病清单(都真实出现过)@@ -2736,6 +2757,30 @@ from core import spline, curve, blob_pts, fbm1d, blur, polygon_mask| 空白纸转成 JPG 后是一张平的数码白(标准差 0) | 纸纹 0.6 % → 1.2 %:空白纸角上 0.49 级(参考图 0.44–0.48 级) || 第一版 16:9 排成 3 + 2 的格子、头高 64 px,小画太小,中间一大块空 | 高的撑伞那幅单独占左边一列,其余四幅排成右边的 2 × 2,头高 84 px |+**颗粒童书**++| 问题 | 改法 |+|---|---|+| 大片天空里的条纹又长又硬,像斜着下雨 | 条纹格子从 60 × 3 缩到 26 × 3.6 px × k,条纹调色的斜率 3.2 → 2.2,`streak` 默认 0.35 → 0.28,天空用 0.3 |+| 形状的边是干净的矢量边,不像参考图那样毛 | 边缘阈值的噪声原来几乎只有条纹和中尺度噪声,改成条纹 0.42 + 纸齿 0.6 + 中尺度 0.35,模糊 1.7 → 2.2 px × k,阈值区间 0.40–0.60 → 0.35–0.65;碎边那一圈颜色深 7 %(`rim`) |+| 颗粒加粗、斑点加多以后,整页像撒了一层沙子 | 纸齿退回 1 px 级的细颗粒,`G` 里只加一层约 1 px 成团的;斑点率从亮 1.2 %、暗 0.9 % 降到 0.5 %、0.35 %;`scumble` 的跳色主要看条纹(`skip=0.8`),不再是椒盐点 |+| 天空分层是一条条横着的硬边,像一面旗 | `bands(blend=)`:每一层的颜色再往上干扫一段(约 40 px × k,覆盖 0.4),层边碎开 |+| `mottle` 的大斑块像迷彩,一块块浮在天上和雪地上 | 斑块边缘放宽(阈值 ±0.015 → ±0.05,`edge` 1.8、`soft` 2.5、`dry` 0.55),和底色差得少一点;地上的浅色改用 `scumble` |+| 两侧的松树又齐又尖、上面挂着雪点,像圣诞树 | `pine()` 每层枝长随机 0.62–1.22 倍、14 % 的枝空着、角度抖 ±9°,深色树干只露底下一截;飘雪的总量减到约一半 |+| 小孩戴红帽子、白帽檐、白绒球,像圣诞老人的帽子 | 帽子改芥末黄,红色留给围巾和手套 |+| 烟囱的烟是一串斜线小团,像涂鸦 | `smoke()` 改成三团大而淡的圆,条纹 0.15,边上干,从烟囱口挨着往上长 |+| 窗里的灯光在雪地上铺成几块方形,像水里的倒影 | 去掉 |+| 从小屋到画面底下踩出来的一条路,像一道光柱 | 去掉,雪地上改成大块、淡的深色斑 |+| 小狗身子长、腿直,像一张桌子;白肚皮像贴了一块胶布 | 身子缩到 0.33 倍、对角腿一前一后小跑,白色挪到胸口 |+| 雪点正好落在小孩的眼睛上 | `snow(avoid=脸)` |+| 走路时围巾尾巴横着飞出去,像一只翅膀 | 尾巴从远处的肩上往后下方垂 |+| 大眼睛的黑眼珠几乎填满眼白,像两颗黑纽扣 | 眼珠半径 0.27 ×(宽 + 高)→ 0.25 × 宽 |+| 长发是一大块黑色的帘子,脸像嵌在假发里 | 发量往转头的反方向(背后)偏,脸前一侧窄,发梢参差;坐着的女孩 `hair_len` 0.75 |+| 扬起来撒面包屑的手像在竖大拇指 | 改成一个掌心朝上、往前倾的扁椭圆,不画拇指 |+| 穿红外套的小孩站在红房子前面,融进墙里 | 外套换对比色(范例里是亮蓝) |+| 颜色比参考图灰(平均色度 87 / 78,参考图 72–134) | 钴蓝、朱红、橙、桃粉色的雪都往参考图实测的颜色推,平均色度到约 100 |+| 远处山脊上的小冷杉只有几个像素高,看不出来 | 竖页 70 → 95 px,宽页 46 → 66 px |+## 四、做成动画- 各画风都有 `stage(name)` 和 `save(path, stages_dir)`,按阶段依次淡入叠化,就是「一幅画被逐步画出来」。README 里的动图就是这样做的。@@ -2854,6 +2899,12 @@ from core import spline, curve, blob_pts, fbm1d, blur, polygon_mask- 调色板:第一帧是空白纸,只给 8 色;228 色只从和它不同的像素里切(末帧 ×3、饱和色 ×3——红色的点睛、芥末黄、绿、橄榄绿、粉蓝,暗色 ×2——藏青、头发、猫);再强制放 11 个颜料色(红、近黑、芥末黄、绿、橄榄绿、粉蓝、蓝、米色、浅灰、纸色、墨色),剩下 8 色只从末帧误差超过 12 级的像素里切;最后 1 色是纯品红,当「和上一帧相同」的透明占位色。- 固定 4×4 Bayer(约 ±2.4 级),末帧不加抖动、精确发送;和屏上已显示颜色差不到 5 级(叠化帧)或 3 级(关键帧)的像素沿用上一帧。- 结果:30 帧,10.70 秒,约 0.20 MB,按解码结果逐帧自检(和应显示的画面最大差 0),末帧误差中位数 0、p99 12。平涂色块加大片白纸,所以小。+- 颗粒童书的动图(脚本在 `workspace_projects/arte7/work/make_gif_grainbook.py`,两张共用):+ - 雪夜遛狗是 1600×2000 的满幅竖页,四周没有白纸可补,不硬塞也不裁:范例有 `--layout wide`,把同一页(小屋、三棵松、小孩和小狗、松枝丛)按 16:9 重新摆成 1920×1080,动图用这一版的阶段;喂鸭子本来就是 16:9。都缩成 720×405(LANCZOS)。+ - 阶段:雪夜遛狗 空页 → 天 → 山脊 → 小屋和松树 → 雪地 → 小孩 → 小狗 → 牵绳 → 成品(飘雪);喂鸭子 空页 → 天 → 对岸 → 水面 → 码头 → 女孩 → 鸭子 → 芦苇和睡莲 → 成品(面包屑和归鸟)。每段 900 毫秒加 5 帧叠化,末帧停 2600 毫秒;叠化一片片铺上去。+ - 调色板:第一帧是空的奶油色页,只给 8 色;228 色只从和它不同的像素里切(末帧 ×3、饱和色 ×3——朱红、橙、钴蓝、芥末黄、几种绿,暗色 ×2——藏青、松绿、头发);再强制放 15 个颜料色,剩下 4 色从末帧误差超过 12 级的像素里切;最后 1 色是纯品红,当「和上一帧相同」的透明占位色。+ - 固定 4×4 Bayer(约 ±2.4 级),末帧不加抖动、精确发送;和屏上已显示颜色差不到 5 级(叠化帧)或 3 级(关键帧)的像素沿用上一帧。+ - 结果:两张都是 40 帧、13.40 秒;雪夜遛狗 1.10 MB、喂鸭子 0.95 MB(满幅的颗粒让每次叠化几乎每个像素都在变,所以比留白多的画风大),按解码结果逐帧自检(和应显示的画面最大差 0),末帧误差中位数 2、p99 26 / 24。- 绘本角色动画的动图是真动画,不是阶段叠化:`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 遮罩按顺序显现。这个还没做成现成接口。@@ -2942,6 +2993,7 @@ lib/poetichalloween.py 诗意万圣夜(直方图均衡的暗色画板纸纹与lib/oilpastel.py 油画棒肖像(直方图均衡的白纸纸纹、沿 8 个方向拖得更长的纸纹(uint8);和色粉小像同一套按段编号的 id 图光栅化,按 y 分带;宽度不变的棒:钝而饱满的起笔、略摆的两侧,分道的磨损面(每道自己的压力、明暗、第二色和终点:一道道断掉的硬梳齿笔尾),陡阈值的纸纹露白,已有蜡的地方吃蜡更多;近乎不透明的蜡混色和带底色的拖色;按噪声加纸纹断开的裁边、每段边冲出距离各不相同的 spill;平行干笔铺色、给定路径的干笔;抖动、分段搭接、粗细不一、偶尔断开和补笔的黑色蜡笔线;排线腮红、短色条、干刷投影、热气;压低眼皮的黑眼睛、粗眉、平涂嘴唇、收尖的长发丝;渲染时透出的纸纹、按颜色深浅减弱的蜡厚度、颗粒和极轻的柔化)lib/sketchbook.py 手账线描(暖米白纸:直方图均衡的细纸纹、极淡的斑驳和纤维、一张可平铺的道子纹理;墨线:样条加慢手抖和快颤、起笔细收笔挑尖、粗细和墨色慢慢变、偶尔抬笔断开,按粗细和深浅不变切段、在 4 倍超采样图层里画,纸坑里断一点,正片叠底;一到三笔、接口留缺口或搭过头的轮廓;沿笔方向的 (u, s) 坐标里的彩铅 / 马克笔:长道子、顺笔细颗粒、挂纸纹或平铺、可选排线,颜色正片叠底;按角度、弯度或中心线排的彩虹条纹,每条自己的颜色、宽度、倾斜、颗粒、压力、两条游移的边和自己的出界阈值;圆粉腮红、圆点、闭眼弧线和睫毛、小红嘴;在导线之间插出、和相邻的线同相起伏、发梢收尖的一绺发丝;带人字叶脉或留白叶脉的单片叶子、螺旋 / 雏菊 / 郁金香小花、细线树、带卷的热气、短毛刺、小涂鸦;渲染时的纸面颗粒和极轻的柔化)lib/spotillo.py 日系扁平小插画(按弧长重采样、沿法向推周期起伏的手剪边,3 倍超采样的包围盒小块光栅化、细噪声取阈值的毛边,不透明平涂,clip / avoid;按中尺度噪声断续的白缝;两头收尖的细线、按底色自动选白或深一号的衣褶线;按头高给关节的姿势预设(站、走、坐、蹲、伸手)、整个人转角度、hooks 插道具的人:粗管袖子和裤腿、在自己坐标系里搭的宽松上衣、白纸脸加侧脸线和点眼、鼓包头发刻白发丝、指头鼓包和红指缝的手、球鞋 / 袜子脚、帽子;马克杯、碗、锅、托特包、伞、自行车、长椅、椅子、扶手椅、沙发、小凳、桌子、橱柜、盆栽、书、猫、窗;热气、惊讶线、z、雨、运动短线、影子;渲染时的斑驳、细颗粒、发白小点、纸纹和极轻的柔化)+lib/grainbook.py 颗粒童书(每页一次的纸齿 / 颗粒 / 中尺度 / 大斑驳 / 斑点纹理;按 7.5° 用到才生成、存成 uint8 大方块、随机偏移读取的条纹纹理;包围盒大小的 Region 遮罩与并、交、差;一次干颗粒填色:顺笔毛边、碎边深一圈、往边上掉的压力和跳色、亮暗条纹调色、细颗粒和大斑驳,涂色 / 正片叠底 / 滤色;分层天空和干扫过渡、斑块、干笔擦扫、投影、光圈;干笔、蜡笔点睛线、颗粒小点;黑白大眼、点点眼、腮红、鼻、嘴、眉,四种发型、毛线帽,站 / 走 / 坐的小孩;小屋、羽状松、远处冷杉、圆树、灌木、松枝丛、杯子、纸盒、纸袋、盆栽、芦苇、草丛、路灯、小狗、鸭子、栅栏;雪、星、月牙、炊烟、热气、涟漪、脚印;渲染时的颗粒、深浅斑点和极轻柔化)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_grainbook_duck_pond.gif b/examples/drawing_grainbook_duck_pond.gifnew file mode 100644index 0000000..66ef722Binary files /dev/null and b/examples/drawing_grainbook_duck_pond.gif differdiff --git a/examples/drawing_grainbook_snow_walk.gif b/examples/drawing_grainbook_snow_walk.gifnew file mode 100644index 0000000..df52b26Binary files /dev/null and b/examples/drawing_grainbook_snow_walk.gif differdiff --git a/examples/grainbook_duck_pond.jpg b/examples/grainbook_duck_pond.jpgnew file mode 100644index 0000000..1a5c3e7Binary files /dev/null and b/examples/grainbook_duck_pond.jpg differdiff --git a/examples/grainbook_duck_pond.py b/examples/grainbook_duck_pond.pynew file mode 100644index 0000000..7ee19a8--- /dev/null+++ b/examples/grainbook_duck_pond.py@@ -0,0 +1,136 @@+"""Example (grainy picture book): 喂鸭子 · Feeding the Ducks -- a girl on a jetty at dusk, ducks paddling over.++A full-bleed 16:9 picture-book spread at dusk: a sky stepped from cobalt through a pale band to apricot and orange,+a tomato sun sinking behind the dark trees of the far bank, its light lying on the water in broken orange strokes;+on the left a wooden jetty runs out into a dusty-blue pond, and at its end a girl with long black hair, big round+black-and-white eyes and rosy cheeks sits with her legs dangling over the water, a paper bag on her lap, tossing+crumbs; three ducks paddle toward her, ripples spreading behind them; lily pads and reeds in the near corner, two+birds flying home. Every shape is laid with a dry, chalky, grainy brush; no ink outlines.++Drawn back to front; --stages writes a snapshot after each group (sky, far bank, water, jetty, girl, ducks,+reeds and lily pads, crumbs and birds). No image model.+python3 grainbook_duck_pond.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 grainbook import GrainBook+++def scene(g, stage):+ W, H = g.W, g.H+ k = g.k+ r = np.random.default_rng(5)+ horizon = 452+ # ------------------------------------------------------------ dusk: cobalt -> pale -> apricot -> orange+ g.bands(g.full(), ['cobalt_deep', 'cobalt', 'dusty_light', 'apricot', 'orange_light'], [120, 215, 300, 370],+ angle=-8, streak=0.3, dry=0.35, edge=1.8, soft=2.4, wave=26 * k, period=300 * k, blend=46 * k)+ g.scumble(g.below(*g.wavy(-20, W + 20, 330, 14 * k, 400 * k)), 'orange_light', angle=-6, cover=0.35, alpha=0.7)+ g.stars(0, 0, W, 170, 12, colour='cream')+ sx, sy, sr = 1480, 398, 92+ g.fill(g.ellipse(sx, sy, sr), 'tomato', angle=0, streak=0.25, dry=0.15, dry_px=10 * k)+ stage('sky')+ # ------------------------------------------------------------ the far bank: dark trees against the glow+ xs, ys = g.wavy(-20, W + 20, horizon, 6 * k, 900 * k, seed=3)+ for x in np.arange(-40, W + 60, 64):+ hh = r.uniform(40, 95) * k * (1.4 if 1000 < x < 1350 or x < 300 else 1.0)+ g.fill(g.blob(x + r.uniform(-20, 20), horizon - hh * 0.3, r.uniform(48, 80) * k, hh * 0.55, rough=0.12),+ 'pine_mid' if r.random() < 0.55 else 'pine', angle=-60, streak=0.25, dry=0.3, dry_px=8 * k)+ g.round_tree(250, horizon + 10, 190 * k * 0.75, 160 * k * 0.75, crown='green', light='moss', seed=4)+ g.round_tree(1160, horizon + 8, 220 * k * 0.75, 170 * k * 0.75, crown='pine_mid', light='green', seed=6)+ g.round_tree(1760, horizon + 8, 170 * k * 0.75, 140 * k * 0.75, crown='green', light='moss', seed=7)+ stage('far_bank')+ # ------------------------------------------------------------ the pond+ water = g.below(xs, ys + 4)+ g.bands(water, ['teal', 'dusty', 'dusty_light'], [570, 790], angle=0, streak=0.45, dry=0.3, edge=1.6, soft=2.0,+ wave=14 * k, period=260 * k, blend=60 * k)+ g.fill(water - g.below(*g.wavy(-20, W + 20, horizon + 40 * k, 8 * k, 200 * k, seed=12)), 'pine', angle=0,+ streak=0.4, dry=0.5, edge=1.4, alpha=0.7) # the bank's reflection+ y = horizon + 26+ for i in range(10): # the sun lying on the water+ w = (190 - i * 13) * k * r.uniform(0.7, 1.1)+ x0 = sx + r.uniform(-30, 30) * k+ n = 1 if (i < 3 or r.random() < 0.5) else 2+ for part in range(n):+ xa = x0 if n == 1 else x0 + (part - 0.5) * w * 0.75+ ww = w if n == 1 else w * 0.55+ g.brush([(xa - ww / 2, y), (xa + ww / 2, y + r.uniform(-2, 2))], (7 + i * 0.45) * k,+ 'orange_light' if i % 3 else 'apricot', taper=(0.45, 0.45), dry=0.45, alpha=0.85)+ y += (22 + i * 5) * k * r.uniform(0.85, 1.15)+ stage('water')+ # ------------------------------------------------------------ the jetty, running in from the left+ top_y, front = 700, 742+ end = 760+ for px in (90, 330, 570, 735): # posts and their wobbling reflections+ g.fill(g.rect(px - 13, front - 8, px + 13, front + 120), 'wood_dark', angle=90, dry=0.1, dry_px=4 * k)+ for j in range(4):+ yy = front + 130 + j * 26+ g.brush([(px - 14 + 6 * (-1) ** j, yy), (px + 14 + 6 * (-1) ** j, yy)], 9 * k, 'teal', taper=(0.2, 0.2),+ dry=0.3, alpha=0.8)+ g.fill(g.poly([(-30, top_y + 6), (end, top_y), (end + 12, front), (-30, front + 8)]), 'wood_dark', angle=0,+ streak=0.4, dry=0.15)+ g.fill(g.poly([(-30, top_y - 30), (end - 22, top_y - 20), (end, top_y), (-30, top_y + 6)]), 'wood', angle=0,+ streak=0.45, dry=0.15)+ for x in np.arange(70, end, 95): # plank seams+ g.crayon([(x, top_y - 22), (x + 6, top_y + 3)], 3.2 * k, 'wood_dark', taper=(0.1, 0.1), alpha=0.7)+ stage('jetty')+ # ------------------------------------------------------------ the girl at the end, legs over the water+ gx, gy, gh = 600, top_y - 6, 640+ g.shadow(g.ellipse(gx - 10, gy + 4, 130, 14), 'wood_dark', depth=0.5, edge=0.8)+ J = g.child(gx, gy, gh, facing=1, pose='sit',+ outfit=dict(coat='vermilion', legs='cream', boots='black', hair_style='long', hair='hair', hair_len=0.75,+ scarf=None, mittens=None, eyes='big', turn=0.32, look=(0.7, 0.45), mouth='smile',+ nose='button', brows=True, buttons='cream', collar='cream', eye_size=1.15),+ el_n=(0.24, -0.3), wr_n=(0.36, -0.34),+ hooks=dict(behind=lambda: g.bag(gx - 0.27 * gh, gy + 0.005 * gh, 0.13 * gh, 0.16 * gh, 'kraft')))+ # an open hand, palm up, just letting go of the crumbs: a small flat skin oval tipped forward+ hx, hy = J['wr_n']+ g.fill(g.blob(hx + 0.026 * gh, hy + 0.002 * gh, 0.036 * gh, 0.018 * gh, rough=0.04, rot=np.deg2rad(-12)), 'skin',+ angle=0, dry=0, edge=0.6)+ stage('girl')+ # ------------------------------------------------------------ the ducks paddling over+ for (x, y, s, f, c, wing) in ((1040, 860, 190, -1, 'cream', None), (1290, 800, 160, -1, 'cream', None),+ (1210, 940, 120, -1, 'brown_light', 'brown')):+ g.ripples(x + 0.25 * s, y + 0.04 * s, 1.2 * s, n=3, colour='ice', alpha=0.75)+ g.shadow(g.ellipse(x + 0.02 * s, y + 0.02 * s, 0.48 * s, 0.05 * s), 'teal', depth=0.6, edge=0.8)+ g.duck(x, y, s, f, colour=c, wing=wing)+ stage('ducks')+ # ------------------------------------------------------------ the near corner: lily pads and reeds+ for (x, y, rr) in ((1560, 1010, 70), (1690, 960, 52), (1450, 1060, 58), (1800, 1040, 62)):+ pad = g.ellipse(x, y, rr * k * 0.8, rr * k * 0.28) - g.poly([(x, y), (x + rr * k, y - rr * k * 0.12),+ (x + rr * k, y + rr * k * 0.12)])+ g.fill(pad, 'moss', angle=0, streak=0.35, dry=0.2, dry_px=4 * k)+ g.dots([(1580, 995)], 9 * k, 'cream')+ g.dots([(1580, 995)], 4 * k, 'mustard')+ g.reeds(1860, 1090, 420 * k * 0.75, n=6, colour='pine_mid', head='brown', spread=150, seed=9)+ g.reeds(60, 1095, 300 * k * 0.75, n=4, colour='pine', head='brown', spread=90, seed=10)+ stage('reeds')+ # ------------------------------------------------------------ crumbs in the air and two birds flying home+ t = np.linspace(0.15, 1, 9)+ ax, ay = hx + 0.03 * gh, hy - 0.02 * gh+ crumbs = np.stack([ax + t * 330 + r.uniform(-12, 12, 9), ay - 70 * np.sin(np.pi * t * 0.8) + t * 170 ++ r.uniform(-10, 10, 9)], 1)+ g.dots(crumbs, r.uniform(3.5, 6, 9) * k, 'cream')+ g.ripples(ax + 340, ay + 190, 70, n=2, colour='ice', alpha=0.7)+ for (bx, by, bs) in ((820, 120, 26), (900, 160, 20)):+ g.crayon([(bx - bs, by - 0.25 * bs), (bx - bs * 0.45, by - 0.45 * bs), (bx, by)], 3.4 * k, 'navy',+ taper=(0.2, 0.1))+ g.crayon([(bx, by), (bx + bs * 0.45, by - 0.45 * bs), (bx + bs, by - 0.25 * bs)], 3.4 * k, 'navy',+ taper=(0.1, 0.2))+++def main():+ out = sys.argv[1] if len(sys.argv) > 1 and not sys.argv[1].startswith('--') else 'grainbook_duck_pond.jpg'+ stages = sys.argv[sys.argv.index('--stages') + 1] if '--stages' in sys.argv else None+ T0 = time.time()+ g = GrainBook(1920, 1080, seed=12, keep_stages=bool(stages), stages_dir=stages)+ g.finish()+ g.paper()+ g.stage('paper')+ scene(g, g.stage)+ g.save(out, stages_dir=stages)+ print('saved', out, f'{time.time() - T0:.1f}s')+++if __name__ == '__main__':+ main()diff --git a/examples/grainbook_snow_walk.jpg b/examples/grainbook_snow_walk.jpgnew file mode 100644index 0000000..b0ede82Binary files /dev/null and b/examples/grainbook_snow_walk.jpg differdiff --git a/examples/grainbook_snow_walk.py b/examples/grainbook_snow_walk.pynew file mode 100644index 0000000..5311b4a--- /dev/null+++ b/examples/grainbook_snow_walk.py@@ -0,0 +1,140 @@+"""Example (grainy picture book): 雪夜遛狗 · The Evening Walk -- a child walking a little dog home in the snow.++A full-bleed picture-book page on a snowy blue evening: a cobalt sky stepped from navy at the top to bright cobalt at+the hills, falling snow; a red cottage on the rise with lit windows, its chimney smoking, feathery pines around it and+small blue firs along the far ridge; on the peach snow in front, a child in a bright blue coat, a red knitted hat and+a mustard scarf walks a ginger dog on a red lead along a trodden path, footprints behind them, flat mauve shadows+under them and the windows' light lying on the snow. Every shape is laid with a dry, chalky, grainy brush; no ink+outlines -- only a few dark crayon accents (window bars, the lead, the mouth).++Drawn back to front; --stages writes a snapshot after each group (sky, ridge, cottage and pines, the ground, the+child, the dog, the lead and shadows, the falling snow). --layout wide arranges the same page as a 1920 x 1080+spread (used for the draw-on GIF). No image model.+python3 grainbook_snow_walk.py [out.jpg] [--stages DIR] [--layout page|wide]+"""+import os, sys, time+sys.path.insert(0, os.path.join(os.path.dirname(os.path.abspath(__file__)), '..', 'lib'))+import numpy as np+from grainbook import GrainBook++LAYOUTS = {+ # canvas, horizon of the far ridge, cottage (x, ground, w, h, depth), pines [(x, ground, h, w)], far firs band,+ # child (x, ground, h), dog (x, ground, size), path control points+ 'page': dict(size=(1600, 2000), sky=[300, 620, 900], ridge=1120, rise=1260,+ house=(1010, 1230, 300, 260, 260), pines=[(1470, 1290, 980, 520), (720, 1250, 560, 300),+ (110, 1420, 1100, 560)],+ firs=(0, 1600, 1105, 95), child=(540, 1860, 800), dog=(1010, 1890, 330),+ moon=(330, 250, 70),+ bushes=[(1500, 2010, 230, 330), (60, 2015, 190, 260)]),+ 'wide': dict(size=(1920, 1080), sky=[150, 330, 500], ridge=600, rise=690,+ house=(1260, 680, 230, 200, 210), pines=[(1700, 760, 720, 400), (1040, 700, 400, 220),+ (130, 840, 780, 420)],+ firs=(0, 1920, 590, 66), child=(690, 990, 470), dog=(990, 1010, 200),+ moon=(420, 130, 46),+ bushes=[(1860, 1090, 170, 240), (360, 1095, 120, 170)]),+}+++def scene(g, L, stage):+ W, H = g.W, g.H+ k = g.k+ r = np.random.default_rng(11)+ # ------------------------------------------------------------ the sky: stepped navy -> bright cobalt+ sky = g.full()+ g.bands(sky, ['navy', 'cobalt_deep', 'cobalt', 'cobalt_bright'], L['sky'], angle=-12, streak=0.3, dry=0.35,+ edge=1.8, soft=2.4, wave=46 * k, period=360 * k)+ g.mottle(g.above(*g.wavy(-20, W + 20, L['sky'][1], 30 * k, 500 * k)), 'cobalt_deep', scale=160 * k, cover=0.3,+ angle=-12, streak=0.35, alpha=0.75)+ g.mottle(g.below(*g.wavy(-20, W + 20, L['sky'][1], 30 * k, 500 * k)), 'cobalt', scale=170 * k, cover=0.25,+ angle=-10, streak=0.35, alpha=0.7)+ mx, my, mr = L['moon']+ g.moon(mx, my, mr, 'cream', halo=0, crescent=0.42)+ stage('sky')+ # ------------------------------------------------------------ the far ridge and its little firs+ xs, ys = g.wavy(-20, W + 20, L['ridge'], 22 * k, 900 * k, seed=5)+ ridge = g.below(xs, ys)+ g.fill(ridge, 'snow_shade', angle=-5, streak=0.4, dry=0.3)+ x0, x1, yb, fh = L['firs']+ for x in np.sort(r.uniform(x0, x1, 22)):+ yy = np.interp(x, xs, ys) + 6 * k+ hh = fh * r.uniform(0.6, 1.15)+ g.fir_far(x, yy, hh, colour='dusty_dark' if r.random() < 0.5 else 'dusty', seed=int(r.integers(1 << 30)))+ xs2, ys2 = g.wavy(-20, W + 20, L['rise'], 34 * k, 1300 * k, seed=8, slope=-0.04)+ rise = g.below(xs2, ys2)+ stage('ridge')+ # ------------------------------------------------------------ the cottage and the pines behind / beside it+ hx, hy, hw, hh, hd = L['house']+ pines = L['pines']+ px, py, ph, pw = pines[0]+ g.pine(px, py, ph, pw, colour='pine', light='pine_mid', snow='snow_light', seed=21)+ px, py, ph, pw = pines[1]+ g.pine(px, py, ph, pw, colour='pine_mid', light='green', snow='snow_light', seed=22)+ g.fill(rise, 'snow', angle=-6, streak=0.45, dry=0.3, mottle=0.2)+ g.scumble(rise, 'snow_light', angle=-6, cover=0.36)+ H_ = g.house(hx, hy, hw, hh, depth=hd, seed=31)+ g.smoke(*H_['chimney'], 260 * k, colour='ice', n=3, drift=0.35, alpha=0.6, seed=3)+ px, py, ph, pw = pines[2]+ g.pine(px, py, ph, pw, colour='pine', light='pine_mid', snow='snow_light', seed=23)+ stage('cottage')+ # ------------------------------------------------------------ the near snow and the trodden path+ xs3, ys3 = g.wavy(-20, W + 20, L['rise'] + 0.18 * (H - L['rise']), 30 * k, 1100 * k, seed=9, slope=0.05)+ near = g.below(xs3, ys3)+ g.fill(near, 'snow', angle=-4, streak=0.45, dry=0.3, mottle=0.25)+ g.scumble(near, 'snow_light', angle=-4, cover=0.42)+ # the snow is uneven: loose, slightly darker patches lying across it+ g.mottle(near, '#e9a9a0', scale=230 * k, cover=0.28, angle=-4, streak=0.3, alpha=0.55, seed=60)+ for (bx, by, bh, bw) in L['bushes']:+ g.shrub(bx, by, bh, bw, 'pine', light='pine_mid', snow='snow_light', seed=int(bx))+ stage('ground')+ # ------------------------------------------------------------ the child, walking the dog home+ cx, cy, ch = L['child']+ dx, dy, ds = L['dog']+ # footprints behind them+ fp = [(cx - ch * (0.22 + 0.17 * i), cy + ch * (0.02 + 0.03 * i) + (8 * k if i % 2 else -8 * k)) for i in range(6)]+ g.footprints(fp, 0.035 * ch, depth=0.6)+ g.footprints([(dx - ds * (0.7 + 0.28 * i), dy + ds * 0.02 * i + (5 * k if i % 2 else -5 * k)) for i in range(5)],+ 0.035 * ds, depth=0.5)+ g.shadow(g.blob(cx - 0.06 * ch, cy + 0.01 * ch, 0.27 * ch, 0.035 * ch, rough=0.1), 'shadow', depth=0.9,+ angle=0, edge=1.2)+ J = g.child(cx, cy, ch, facing=1, pose='walk',+ outfit=dict(coat='cobalt_bright', sleeve='#1668bd', legs='navy', boots='brick', hair_style='bob',+ hat='mustard', hat_band='cream', scarf='vermilion', mittens='vermilion', eyes='dot',+ turn=0.45, look=(0.5, 0.0), buttons='cream'),+ el_n=(0.2, -0.55), wr_n=(0.29, -0.47))+ stage('child')+ g.shadow(g.blob(dx - 0.05 * ds, dy + 0.01 * ds, 0.45 * ds, 0.05 * ds, rough=0.1), 'shadow', depth=0.9,+ angle=0, edge=1.2)+ D = g.dog(dx, dy, ds, facing=1, colour='orange', patch='cream', collar='vermilion')+ stage('dog')+ # ------------------------------------------------------------ the lead, sagging between hand and collar+ a = np.array(J['wr_n']) + (0.012 * ch, 0.01 * ch)+ b = np.array(D['collar'])+ t = np.linspace(0, 1, 20)[:, None]+ lead = a * (1 - t) + b * t + np.array([0, 1]) * (np.sin(np.pi * t) * 0.07 * ch)+ g.crayon(lead, 4.5 * k, 'vermilion', taper=(0.05, 0.05), wobble=0.5)+ stage('lead')+ # ------------------------------------------------------------ falling snow over everything+ face = J['face']['head']+ g.snow(0, 0, W, H, int(0.00006 * W * H), r=(2.4 * k, 5.2 * k), colour='cream', avoid=face, seed=41)+ g.snow(0, 0, W, H * 0.6, int(0.000012 * W * H), r=(5 * k, 7 * k), colour='white', alpha=0.85, avoid=face,+ seed=42)+++def main():+ out = sys.argv[1] if len(sys.argv) > 1 and not sys.argv[1].startswith('--') else 'grainbook_snow_walk.jpg'+ stages = sys.argv[sys.argv.index('--stages') + 1] if '--stages' in sys.argv else None+ layout = sys.argv[sys.argv.index('--layout') + 1] if '--layout' in sys.argv else 'page'+ T0 = time.time()+ L = LAYOUTS[layout]+ W, H = L['size']+ g = GrainBook(W, H, seed=7, keep_stages=bool(stages), stages_dir=stages)+ g.finish()+ g.paper()+ g.stage('paper')+ scene(g, L, g.stage)+ g.save(out, stages_dir=stages)+ print('saved', out, f'{time.time() - T0:.1f}s')+++if __name__ == '__main__':+ main()diff --git a/lib/grainbook.py b/lib/grainbook.pynew file mode 100644index 0000000..6698d01--- /dev/null+++ b/lib/grainbook.py@@ -0,0 +1,1354 @@+"""grainbook — 颗粒童书 / Grainy Picture Book: sweet mid-century children's-book scenes painted in big flat shapes+with a dry, chalky, grainy brush (numpy + Pillow only).++The look: a full-bleed picture-book page -- no white margin, no vignette -- in a small, saturated palette: cobalt and+ultramarine night skies or a dusty-blue ground, vermilion / tomato red, orange, pine green, cream, peach snow and+black hair. Every thing is one big flat shape, and every shape is laid with a dry, chalky brush: the colour breaks+up into a fine sandy grain (light and dark specks), runs in faint streaks along the stroke, skips the tooth here and+there so the layer underneath shows through, and its edge is a dry, frayed fringe -- shapes meet colour to colour,+with no outline. A few dark crayon strokes for accents (a brow, a window bar, a leash, a smile). Light comes as a+lighter dry-brush scumble on one side; shadows are flat, darker shapes laid over what is there. Faces are simple and+sweet: big round black-and-white eyes or dot eyes, round coral cheeks, a tiny mouth, a button or triangle nose.++Model+ paper The page starts as one warm cream underlayer, so wherever a later layer skips the tooth, cream shows+ through like the ground of a gouache / crayon painting. Shared textures are made once per page: the+ tooth `T` (fine, rank-equalised, uint8), a grain `G` (pixel noise plus a ~1 px-clustered one,+ z-scored), a mid noise `EN` (edge wander), a big mottle `MOT`, a speck map `SP`, and, made on demand and+ cached per 7.5 degrees, a streak texture for each stroke direction: independent noise on grids whose+ cells are long and thin (about 26 x 3.6, 11 x 1.6 and 80 x 13 px x k), upsampled bicubic so each cell+ becomes a streak, summed, rotated to the stroke angle and kept as uint8 in a square larger than the+ page, so every fill reads it at its own random offset.+ regions A shape is a `Region`: a float mask the size of its bounding box plus its offset on the page (so a+ small shape costs a small array). Pillow fills polygons into it at 2x and box-averages back. Regions+ combine with `|` (union), `&` (intersection) and `-` (cut away).+ fill The one paint operation. Inside the region's padded box: the mask is blurred a little and+ thresholded against the streak texture, the tooth and the mid noise, so the edge frays into a crumbly,+ fibrous fringe along the stroke (fingers at the ends of strokes, a wavy edge along them) and the colour+ is a shade darker in that fringe (`rim`); a pressure that falls off toward the edge (`dry`, over+ `dry_px`) is compared with a mix of tooth and streak (`skip`), so the colour skips in specks and thins+ out near the edge; the colour itself moves toward a lighter `hi` on the high streaks and a darker `lo`+ on the low ones (`streak`), with a fine grain and a big soft mottle. Opaque paint:+ new = old + A x (colour - old); `mode='multiply'` lays a shadow over what is there, `mode='screen'` a+ light.+ strokes `brush()` one dry, tapered stroke (a tube region filled along its own direction); `crayon()` a dark+ crayon accent: a tapered ribbon on a wobbling path whose width swells and thins, its coverage broken by+ the tooth and a pressure that wanders along it; `dots()` fuzzy grainy specks (snow, stars, crumbs).+ layers `bands()` paints a region in layered colour bands whose borders are wavy, frayed brush edges, each new+ colour also dry-brushed a little way up into the band above (`blend`) -- a sky stepped like a+ painting, never a digital gradient; `mottle()` loose patches of a second colour; `scumble()` a+ dry-brush pass with low pressure that skips along the streaks (highlights, snow on a roof, light snow+ on the ground); `shadow()` a flat multiplied shape; `glow()` two stepped, dry-edged screen discs.+ finish `finish()` records the finishing (applied in render, so every stage snapshot matches): a fine overall+ grain, sparse light and dark specks (more light ones on dark colour, dark ones on light), and a very+ slight softening.++API (page pixel coordinates; angles in degrees, 0 = to the right, 90 = down; colours are PAINTS names, '#rrggbb' or+ RGB triples; k = min(W, H) / 1000 scales default widths)+ page GrainBook(W, H, seed, keep_stages, stages_dir); finish(grain, speckle, soft) -- before the first mark;+ paper(tone)+ regions poly(pts, smooth) / ellipse(cx, cy, rx, ry, rot) / blob(cx, cy, rx, ry, rough, rot, seed) /+ rect(x0, y0, x1, y1) / tube(path, w0, w1, taper) / below(xs, ys) / above(xs, ys) / full();+ r1 | r2, r1 & r2, r1 - r2; wavy(x0, x1, y, amp, period, seed, slope) -> (xs, ys)+ paint fill(region, colour, angle, streak, grain, mottle, pressure, dry, edge, soft, hi, lo, alpha, clip,+ avoid, mode, seed, dry_px, rim, skip); scumble(region, colour, angle, cover, ...);+ shadow(region, colour, depth, angle); glow(region, colour, strength); bands(region, colours, ys,+ angle, wave, period, blend, ...); mottle(region, colour, scale, cover, angle, ...);+ brush(path, width, colour, taper, ...); crayon(path, width, colour, pressure, taper, wobble);+ dots(pts, r, colour, ...)+ faces face(cx, cy, r, turn, eyes, look, skin, cheeks, mouth, nose, brows, ears, eye_size) -> anchors+ (eyes 'big' / 'dot' / 'closed'); eye_big(cx, cy, w, h, look, highlight, lid) / eye_dot(cx, cy, r) /+ cheek(cx, cy, r) / nose(cx, cy, size, kind) ('button' 'tri' 'line' 'dot') / mouth(cx, cy, w, kind)+ ('smile' 'lips' 'o' 'open') / brow(cx, cy, w, tilt); hair(cx, cy, r, style, colour, turn, layer,+ length) ('bob' 'long' 'short' 'bun'; layer 'back' / 'front'); beanie(cx, cy, r, colour, band, pompom,+ turn)+ figures limb(path, w0, w1, colour, angle); mitten(x, y, r, colour, angle, thumb); boot(x, y, w, colour,+ facing); child(x, y, h, facing, pose, outfit, hooks, **joints) -> joints (pose 'stand' / 'walk' /+ 'sit')+ props house(x, y, w, h, ...) -> anchors; pine(x, y, h, w, ...); fir_far(x, y, h, w, colour);+ round_tree(x, y, h, w, ...); bush(x, y, w, h, colour); shrub(x, y, h, w, ...); cup(x, y, w, ...);+ parcel(x, y, w, h, ...); bag(x, y, w, h, colour); potted(x, y, h, ...); reeds(x, y, h, n, ...);+ tuft(x, y, w, h, ...); lamp(x, y, h, ...); dog(x, y, s, facing, ...) -> anchors;+ duck(x, y, s, facing, ...); fence(x0, x1, y, h, ...)+ sky snow(x0, y0, x1, y1, n, r, ..., avoid); stars(x0, y0, x1, y1, n, ...); moon(x, y, r, colour, halo,+ crescent); smoke(x, y, h, ...); wisp(x, y, h, ...); ripples(x, y, w, n, ...); footprints(pts, size, ...)+ output render(); composite(); stage(name); save(path, stages_dir) -- save('x.jpg') quality 92, 4:4:4 chroma++ import sys; sys.path.insert(0, 'lib')+ from grainbook import GrainBook+ g = GrainBook(1200, 1500, seed=1); g.finish(); g.paper()+ g.bands(g.full(), ['cobalt_deep', 'cobalt', 'cobalt_bright'], [500, 900], angle=-8)+ g.fill(g.below(*g.wavy(0, 1200, 1100, 30, 900)), 'snow', angle=-5)+ g.house(700, 1150, 260, 220)+ g.child(420, 1300, 520, facing=1, pose='walk', outfit=dict(coat='vermilion', hat='cream'))+ g.snow(0, 0, 1200, 1400, 160)+ g.save('page.jpg')+"""+import io+import os+import numpy as np+from PIL import Image, ImageDraw+from core import blur, noise2d, spline, smoothstep, fbm1d++PAINTS = {+ # the cream underlayer and lights+ 'paper': '#f1e2c6', 'cream': '#fbf0d6', 'white': '#fff8ea', 'cream_dark': '#e9d4ae',+ # blues: night skies, dusty grounds, water+ 'navy': '#0a2a60', 'cobalt_deep': '#063f8c', 'cobalt': '#0763bd', 'cobalt_bright': '#0d82ec',+ 'ultramarine': '#2450c4', 'sky_pale': '#7cb9ee', 'dusty': '#4c8db0', 'dusty_light': '#7cb4cc',+ 'dusty_dark': '#336f90', 'teal': '#0f6c8a', 'ice': '#bcdcf2',+ # reds and oranges+ 'vermilion': '#ec3415', 'tomato': '#f7552f', 'red_deep': '#bc2814', 'brick': '#922814', 'orange': '#fc7a28',+ 'orange_light': '#fc9c58', 'apricot': '#f9ae74',+ # greens+ 'pine': '#0f3a30', 'pine_mid': '#1f5a3e', 'green': '#457a3a', 'moss': '#6a9140', 'olive': '#9aa83f',+ 'sage': '#8fae8a',+ # yellows+ 'mustard': '#eaaa38', 'window': '#f8cb50', 'lamp': '#ffe39a', 'gold': '#d99a36',+ # snow at night (peach), its shade+ 'snow': '#f7b8a0', 'snow_light': '#fcd6c3', 'snow_shade': '#df9796', 'snow_blue': '#a6b6dc',+ # skin, cheeks, features+ 'skin': '#fac7a6', 'skin_shade': '#efa98a', 'cheek': '#f4836c', 'nose': '#f06a4c', 'lip': '#e4553c',+ # dark and browns+ 'hair': '#16110e', 'black': '#141110', 'ink': '#241812', 'brown': '#5b3522', 'brown_light': '#8c5a37',+ 'wood': '#a8683c', 'wood_dark': '#6e3f24', 'kraft': '#d2a56c', 'coffee': '#4a2a17', 'shadow': '#c6a6b8', 'shadow_blue': '#8f9cc8',+}+++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 _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 _smooth(path, per=10):+ P = np.asarray(path, np.float32)+ return spline(P, per) if len(P) > 2 else _resample(P, 3)+++def _rot(pts, cx, cy, deg):+ a = np.deg2rad(deg); c, s = np.cos(a), np.sin(a)+ P = np.asarray(pts, np.float32) - (cx, cy)+ return np.stack([P[:, 0] * c - P[:, 1] * s + cx, P[:, 0] * s + P[:, 1] * c + cy], 1)+++def _ncdf(z):+ """a normal-ish noise -> roughly uniform 0..1"""+ return 0.5 * (1 + np.tanh(0.7978 * (z + 0.0447 * z * z * z)))+++class Region:+ """a float mask the size of its bounding box, at offset (y0, x0) on the page"""+ __slots__ = ('y0', 'x0', 'a')++ def __init__(self, y0, x0, a):+ self.y0, self.x0, self.a = int(y0), int(x0), a.astype(np.float32, copy=False)++ @property+ def box(self):+ return self.y0, self.x0, self.y0 + self.a.shape[0], self.x0 + self.a.shape[1]++ def crop(self, y0, x0, y1, x1):+ out = np.zeros((y1 - y0, x1 - x0), np.float32)+ a0, b0, a1, b1 = self.box+ iy0, ix0, iy1, ix1 = max(y0, a0), max(x0, b0), min(y1, a1), min(x1, b1)+ if iy1 > iy0 and ix1 > ix0:+ out[iy0 - y0:iy1 - y0, ix0 - x0:ix1 - x0] = self.a[iy0 - a0:iy1 - a0, ix0 - b0:ix1 - b0]+ return out++ def _pair(self, o, inter=False):+ a, b = self.box, o.box+ if inter: box = (max(a[0], b[0]), max(a[1], b[1]), min(a[2], b[2]), min(a[3], b[3]))+ else: box = (min(a[0], b[0]), min(a[1], b[1]), max(a[2], b[2]), max(a[3], b[3]))+ if box[2] <= box[0] or box[3] <= box[1]: box = (a[0], a[1], a[0] + 1, a[1] + 1)+ return box, self.crop(*box), o.crop(*box)++ def __or__(self, o):+ box, p, q = self._pair(o)+ return Region(box[0], box[1], np.maximum(p, q))++ def __and__(self, o):+ box, p, q = self._pair(o, True)+ return Region(box[0], box[1], np.minimum(p, q))++ def __sub__(self, o):+ p = self.a * (1 - o.crop(*self.box))+ return Region(self.y0, self.x0, p)++ def scaled(self, f):+ return Region(self.y0, self.x0, np.clip(self.a * f, 0, 1))++ def empty(self):+ return not (self.a > 0.02).any()+++class GrainBook:+ PAINTS = PAINTS++ def __init__(self, W=1600, H=2000, seed=0, keep_stages=True, stages_dir=None):+ if W * H > 4096 * 4096: raise ValueError('page larger than 4096 x 4096')+ self.W, self.H, self.seed = W, H, seed+ self.k = min(W, H) / 1000+ self.rng = np.random.default_rng(seed)+ self.keep_stages, self.stages_dir = keep_stages, stages_dir+ self.stages, self._n_stages = [], 0+ self.C = np.empty((H, W, 3), np.float32); self.C[:] = hexc('paper')+ self.fin = None+ self.T = None+ self._streaks = {}+ self.L = int(np.ceil(np.hypot(W, H))) + 16 # side of the streak squares++ def _r(self, seed=None):+ return np.random.default_rng(int(self.rng.integers(1 << 30)) if seed is None else seed)++ # ================================================================== textures+ def _textures(self):+ H, W, k = self.H, self.W, self.k+ r = np.random.default_rng(self.seed * 7919 + 13)+ z = lambda a: (a - a.mean()) / (a.std() + 1e-6)+ t = 0.8 * z(blur(r.standard_normal((H, W)).astype(np.float32), 0.65)) + \+ 0.6 * z(noise2d(H, W, 2.6 * k, 2, int(r.integers(1 << 30))))+ self.T = np.round(_ncdf(z(t)) * 255).astype(np.uint8)+ g = r.standard_normal((H, W)).astype(np.float32)+ g2 = r.standard_normal((H, W)).astype(np.float32)+ self.G = z(0.75 * z(g) + 0.5 * z(blur(g2, 0.7 * k))).astype(np.float32)+ del g2+ self.EN = noise2d(H, W, 9.0 * k, 3, int(r.integers(1 << 30))).astype(np.float32)+ self.MOT = noise2d(H, W, 170.0 * k, 3, int(r.integers(1 << 30))).astype(np.float32)+ self.SP = r.random((H, W)).astype(np.float32)+ del t, g++ def _need(self):+ if self.T is None: self._textures()++ def _streak(self, angle):+ """the streak square for a stroke direction (cached per 7.5 degrees), uint8, L x L"""+ key = int(round((angle % 180) / 7.5)) % 24+ if key in self._streaks: return self._streaks[key]+ L, k = self.L, self.k+ L2 = int(L * 1.42) + 8+ r = np.random.default_rng(self.seed * 101 + key * 7 + 3)+ acc = np.zeros((L2, L2), np.float32)+ for ln, wd, amp in ((26 * k, 3.6 * k, 1.0), (11 * k, 1.6 * k, 0.6), (80 * k, 13 * k, 0.75)):+ gh, gw = int(L2 / max(wd, 1.0)) + 3, int(L2 / ln) + 3+ g = Image.fromarray(r.standard_normal((gh, gw)).astype(np.float32))+ acc += amp * np.asarray(g.resize((L2, L2), Image.BICUBIC), np.float32)+ acc = (acc - acc.mean()) / (acc.std() + 1e-6)+ im = Image.fromarray(acc).rotate(-key * 7.5, resample=Image.BILINEAR)+ o = (L2 - L) // 2+ sq = np.asarray(im, np.float32)[o:o + L, o:o + L]+ sq = (sq - sq.mean()) / (sq.std() + 1e-6)+ out = np.round(_ncdf(sq) * 255).astype(np.uint8)+ self._streaks[key] = out+ return out++ def _streak_at(self, angle, y0, x0, y1, x1, r):+ S = self._streak(angle)+ oy = int(r.integers(0, self.L - self.H + 1)); ox = int(r.integers(0, self.L - self.W + 1))+ return S[y0 + oy:y1 + oy, x0 + ox:x1 + ox].astype(np.float32) / 255++ # ================================================================== page+ def paper(self, tone='paper', angle=-80.0, streak=0.5):+ """the warm underlayer the whole page starts from (it shows wherever a later layer skips)"""+ self._need()+ R = self.full()+ self.C[:] = hexc(tone)+ self.fill(R, tone, angle=angle, streak=streak, pressure=1.2, dry=0, edge=0, mottle=0.25,+ hi=mix(tone, 'white', 0.35), lo=mix(tone, 'cream_dark', 0.9))+ return self++ # ================================================================== regions+ def full(self):+ return Region(0, 0, np.ones((self.H, self.W), np.float32))++ def poly(self, pts, smooth=False, per=10):+ P = np.asarray(pts, np.float32)+ if smooth: P = spline(np.vstack([P, P[:1]]), per)[:-1]+ ss = 2+ x0 = int(np.floor(P[:, 0].min())) - 2; x1 = int(np.ceil(P[:, 0].max())) + 3+ y0 = int(np.floor(P[:, 1].min())) - 2; y1 = int(np.ceil(P[:, 1].max())) + 3+ x0, y0 = max(x0, -4), max(y0, -4)+ x1, y1 = min(x1, self.W + 4), min(y1, self.H + 4)+ if x1 <= x0 or y1 <= y0: return Region(0, 0, np.zeros((1, 1), np.float32))+ im = Image.new('L', ((x1 - x0) * ss, (y1 - y0) * ss), 0)+ ImageDraw.Draw(im).polygon([((x - x0) * ss, (y - y0) * ss) for x, y in P], fill=255)+ a = np.asarray(im, np.float32).reshape(y1 - y0, ss, x1 - x0, ss).mean((1, 3)) / 255+ return Region(y0, x0, a)++ def ellipse(self, cx, cy, rx, ry=None, rot=0.0, n=None):+ ry = rx if ry is None else ry+ n = n or int(np.clip(max(rx, ry) * 0.6, 24, 240))+ t = np.linspace(0, 2 * np.pi, n, endpoint=False)+ P = np.stack([cx + rx * np.cos(t), cy + ry * np.sin(t)], 1)+ return self.poly(_rot(P, cx, cy, rot) if rot else P)++ def blob(self, cx, cy, rx, ry=None, rough=0.08, rot=0.0, seed=None):+ ry = rx if ry is None else ry+ r = self._r(seed)+ n = int(np.clip(max(rx, ry) * 0.6, 40, 260))+ t = np.linspace(0, 2 * np.pi, n, endpoint=False)+ wob = 1 + rough * fbm1d(n, n / 5, 4, int(r.integers(1 << 30)))+ P = np.stack([cx + rx * wob * np.cos(t), cy + ry * wob * np.sin(t)], 1)+ return self.poly(_rot(P, cx, cy, rot) if rot else P)++ def rect(self, x0, y0, x1, y1):+ return self.poly([(x0, y0), (x1, y0), (x1, y1), (x0, y1)])++ @staticmethod+ def tube_pts(path, w0, w1=None, taper=(0.0, 0.0), per=10):+ """outline of a ribbon along a path, width w0 -> w1, tapering to a point over the first / last fraction"""+ P = _smooth(path, per)+ P = _resample(P, 2.0)+ n = len(P)+ if n < 2: P = np.vstack([P, P + 0.5]); n = 2+ w1 = w0 if w1 is None else w1+ t = np.linspace(0, 1, n)+ w = (w0 + (w1 - w0) * t) / 2+ if taper[0] > 0: w = w * np.clip(np.sqrt(np.clip(t / taper[0], 0, 1)), 0.08, 1)+ if taper[1] > 0: w = w * np.clip(np.sqrt(np.clip((1 - t) / taper[1], 0, 1)), 0.08, 1)+ d = np.gradient(P, axis=0); d /= np.linalg.norm(d, axis=1, keepdims=True) + 1e-6+ nrm = np.stack([-d[:, 1], d[:, 0]], 1)+ return np.vstack([P + nrm * w[:, None], (P - nrm * w[:, None])[::-1]])++ def tube(self, path, w0, w1=None, taper=(0.0, 0.0)):+ return self.poly(self.tube_pts(path, w0, w1, taper))++ def below(self, xs, ys):+ """everything under a curve (xs ascending) down to the bottom of the page"""+ P = np.stack([np.asarray(xs, np.float32), np.asarray(ys, np.float32)], 1)+ return self.poly(np.vstack([P, [(P[-1, 0], self.H + 4), (P[0, 0], self.H + 4)]]))++ def above(self, xs, ys):+ P = np.stack([np.asarray(xs, np.float32), np.asarray(ys, np.float32)], 1)+ return self.poly(np.vstack([P, [(P[-1, 0], -4), (P[0, 0], -4)]]))++ def wavy(self, x0, x1, y, amp=20.0, period=600.0, seed=None, slope=0.0, n=None):+ """a wavy horizon: xs, ys from x0 to x1 around y (amp px, wavelength ~period px), optional slope (px per px)"""+ r = self._r(seed)+ n = n or max(8, int((x1 - x0) / 6))+ xs = np.linspace(x0, x1, n)+ ys = y + amp * fbm1d(n, max(2.0, n * period / max(x1 - x0, 1) / 2), 3, int(r.integers(1 << 30))) + \+ slope * (xs - (x0 + x1) / 2)+ return xs, ys++ def _region(self, r):+ if isinstance(r, Region): return r+ if isinstance(r, np.ndarray) and r.shape == (self.H, self.W): return Region(0, 0, r)+ return self.poly(r)++ # ================================================================== paint+ def fill(self, region, colour, angle=0.0, streak=0.28, grain=1.0, mottle=0.12, pressure=1.0, dry=0.3,+ edge=1.0, soft=1.0, hi=None, lo=None, alpha=1.0, clip=None, avoid=None, mode='paint', seed=None,+ dry_px=None, rim=0.07, skip=0.5):+ """lay one colour into a region with a dry, chalky brush (see the module doc)"""+ self._need()+ R = self._region(region)+ if R.empty(): return+ k = self.k+ r = self._r(seed)+ dpx = (9.0 * k) if dry_px is None else dry_px+ pad = int(np.ceil(max(3 * dpx, 8 * k * max(edge, 0.3)) + 4))+ Y0, X0, Y1, X1 = R.box+ y0, x0 = max(0, Y0 - pad), max(0, X0 - pad)+ y1, x1 = min(self.H, Y1 + pad), min(self.W, X1 + pad)+ if y1 <= y0 or x1 <= x0: return+ m = R.crop(y0, x0, y1, x1)+ S = self._streak_at(angle, y0, x0, y1, x1, r)+ G = self.G[y0:y1, x0:x1]+ T = self.T[y0:y1, x0:x1].astype(np.float32) / 255+ EN = self.EN[y0:y1, x0:x1]+ if edge > 0:+ ss = blur(m, 2.2 * k * soft) if soft > 0 else m+ n = 0.42 * (S - 0.5) + 0.6 * (T - 0.5) + 0.35 * (EN - 0.5)+ me = smoothstep(0.35, 0.65, ss + 0.52 * edge * n)+ band = smoothstep(0.25, 0.5, ss) * (1 - smoothstep(0.62, 0.9, ss)) # the edge zone (for the rim)+ else:+ me = m; band = None+ if dry > 0:+ deep = blur(m, dpx)+ p = pressure - dry * (1 - smoothstep(0.5, 0.92, deep))+ else:+ p = pressure+ tex = (1 - skip) * T + skip * S+ cov = smoothstep(tex - 0.07, tex + 0.07, p + 0.03)+ A = alpha * me * cov+ if clip is not None: A *= self._region(clip).crop(y0, x0, y1, x1)+ if avoid is not None: A *= 1 - self._region(avoid).crop(y0, x0, y1, x1)+ if not (A > 0.003).any(): return+ base = hexc(colour)+ hi = mix(base, 'white', 0.16) if hi is None else hexc(hi)+ lo = base * 0.88 if lo is None else hexc(lo)+ t = np.clip((S - 0.5) * 2.2 * streak, -1, 1)[..., None]+ col = base + np.maximum(t, 0) * (hi - base) + np.maximum(-t, 0) * (lo - base)+ v = 1 + 0.042 * grain * G + mottle * 0.3 * (self.MOT[y0:y1, x0:x1] - 0.5)+ if rim and band is not None and mode == 'paint': v = v - rim * band+ col = col * v[..., None]+ C = self.C[y0:y1, x0:x1]+ A3 = A[..., None]+ if mode == 'paint': C += A3 * (col - C)+ elif mode == 'multiply': C *= 1 - A3 * (1 - np.clip(col, 0, 1))+ elif mode == 'screen': C += A3 * np.clip(col, 0, 1) * (1 - C)+ else: raise ValueError(mode)+ np.clip(C, 0, 1.2, out=C)++ def scumble(self, region, colour, angle=0.0, cover=0.45, streak=0.5, **kw):+ """a dry-brush pass: colour only on the high tooth and streaks (a highlight, snow on a roof)"""+ kw.setdefault('dry', 0.15); kw.setdefault('edge', 1.3); kw.setdefault('skip', 0.8)+ self.fill(region, colour, angle=angle, pressure=cover, streak=streak, **kw)++ def shadow(self, region, colour='shadow', depth=1.0, angle=0.0, **kw):+ """a flat cast shadow laid over what is there (multiplied)"""+ kw.setdefault('dry', 0.1); kw.setdefault('streak', 0.25); kw.setdefault('mottle', 0.05)+ c = 1 - depth * (1 - hexc(colour))+ self.fill(region, c, angle=angle, mode='multiply', hi=mix(c, 'white', 0.25), lo=c * 0.95, **kw)++ def glow(self, region, colour='lamp', strength=0.5, angle=0.0, **kw):+ """a grainy screen-blended light (a lit window's spill, a lamp's halo): a faint outer step and a brighter+ inner one, both with dry, broken edges -- a painted halo, not a smooth radial gradient"""+ R = self._region(region)+ kw.setdefault('dry', 0.6); kw.setdefault('edge', 1.8); kw.setdefault('soft', 2.4)+ kw.setdefault('pressure', 0.9); kw.setdefault('skip', 0.7)+ y0, x0, y1, x1 = R.box+ inner = Region(y0, x0, smoothstep(0.35, 0.65, blur(R.a, 0.22 * min(y1 - y0, x1 - x0))))+ self.fill(R, hexc(colour) * strength * 0.45, angle=angle, mode='screen', **kw)+ self.fill(inner, hexc(colour) * strength * 0.6, angle=angle, mode='screen', **kw)++ def bands(self, region, colours, ys, angle=0.0, wave=None, period=None, blend=None, seed=None, **kw):+ """colours[0] over the whole region, then colours[i + 1] below the wavy border ys[i] (a stepped sky); each+ new colour is also dry-brushed `blend` px up into the band above it, so a border breaks up like a painted+ one instead of a cut"""+ R = self._region(region)+ r = self._r(seed)+ wave = 26 * self.k if wave is None else wave+ period = 500 * self.k if period is None else period+ blend = 40 * self.k if blend is None else blend+ self.fill(R, colours[0], angle=angle, seed=int(r.integers(1 << 30)), **kw)+ for c, y in zip(colours[1:], ys):+ xs, yy = self.wavy(-20, self.W + 20, y, wave, period, int(r.integers(1 << 30)))+ if blend > 0:+ strip = R & (self.below(xs, yy - blend) - self.below(xs, yy + 4))+ self.scumble(strip, c, angle=angle, cover=0.4, alpha=0.9, seed=int(r.integers(1 << 30)))+ self.fill(R & self.below(xs, yy), c, angle=angle, seed=int(r.integers(1 << 30)), **kw)++ def mottle(self, region, colour, scale=None, cover=0.35, angle=0.0, seed=None, **kw):+ """loose patches of a second colour over a region (the uneven body of a painted sky or field)"""+ R = self._region(region)+ r = self._r(seed)+ scale = 120 * self.k if scale is None else scale+ y0, x0, y1, x1 = R.box+ n = noise2d(y1 - y0, x1 - x0, scale, 3, int(r.integers(1 << 30)))+ q = np.quantile(n, 1 - cover)+ patch = Region(y0, x0, R.a * smoothstep(q - 0.05, q + 0.05, n))+ kw.setdefault('dry', 0.55); kw.setdefault('edge', 1.8); kw.setdefault('soft', 2.5)+ self.fill(patch, colour, angle=angle, seed=int(r.integers(1 << 30)), **kw)++ def brush(self, path, width, colour, taper=(0.12, 0.35), w1=None, angle=None, **kw):+ """one dry, tapered brush stroke along a path"""+ P = np.asarray(path, np.float32)+ if angle is None:+ d = P[-1] - P[0]+ angle = float(np.degrees(np.arctan2(d[1], d[0])))+ kw.setdefault('dry', 0.25); kw.setdefault('dry_px', max(2.0, width * 0.35)); kw.setdefault('soft', 0.7)+ self.fill(self.tube(P, width, w1, taper), colour, angle=angle, **kw)++ def crayon(self, path, width=None, colour='ink', pressure=0.85, taper=(0.15, 0.25), wobble=1.0, alpha=1.0,+ w1=None, seed=None):+ """a dark crayon accent: a tapered ribbon on a wobbling path, broken by the tooth"""+ self._need()+ k = self.k+ r = self._r(seed)+ width = 5 * k if width is None else width+ P = _resample(_smooth(path), 2.0)+ if len(P) < 2: return+ n = len(P)+ if wobble:+ d = np.gradient(P, axis=0); d /= np.linalg.norm(d, axis=1, keepdims=True) + 1e-6+ nrm = np.stack([-d[:, 1], d[:, 0]], 1)+ P = P + nrm * (wobble * 0.9 * k * fbm1d(n, max(4, n / 5), 3, int(r.integers(1 << 30))))[:, None]+ wv = 1 + 0.18 * fbm1d(n, max(4, n / 4), 2, int(r.integers(1 << 30)))+ d = np.gradient(P, axis=0); d /= np.linalg.norm(d, axis=1, keepdims=True) + 1e-6+ nrm = np.stack([-d[:, 1], d[:, 0]], 1)+ t = np.linspace(0, 1, n)+ w = (width + ((width if w1 is None else w1) - width) * t) / 2 * wv+ if taper[0] > 0: w = w * np.clip(np.sqrt(np.clip(t / taper[0], 0, 1)), 0.1, 1)+ if taper[1] > 0: w = w * np.clip(np.sqrt(np.clip((1 - t) / taper[1], 0, 1)), 0.1, 1)+ pts = np.vstack([P + nrm * w[:, None], (P - nrm * w[:, None])[::-1]])+ R = self.poly(pts)+ y0, x0, y1, x1 = R.box+ y0, x0, y1, x1 = max(0, y0), max(0, x0), min(self.H, y1), min(self.W, x1)+ if y1 <= y0 or x1 <= x0: return+ m = blur(R.crop(y0, x0, y1, x1), 0.6 * k)+ T = self.T[y0:y1, x0:x1].astype(np.float32) / 255+ G = self.G[y0:y1, x0:x1]+ EN = self.EN[y0:y1, x0:x1]+ me = smoothstep(0.32, 0.62, m + 0.16 * (EN - 0.5) + 0.04 * G)+ p = pressure + 0.25 * (EN - 0.5)+ cov = smoothstep(T - 0.12, T + 0.12, p + 0.08)+ A = (alpha * me * cov)[..., None]+ col = hexc(colour) * (1 + 0.06 * G)[..., None]+ C = self.C[y0:y1, x0:x1]+ C += A * (col - C)++ def dots(self, pts, r, colour='cream', alpha=1.0, seed=None, **kw):+ """fuzzy, grainy specks at points (snow, stars, crumbs); r a number or one per point"""+ pts = np.asarray(pts, np.float32).reshape(-1, 2)+ if not len(pts): return+ rr = np.broadcast_to(np.asarray(r, np.float32), (len(pts),))+ x0 = int(np.floor((pts[:, 0] - rr).min())) - 3; x1 = int(np.ceil((pts[:, 0] + rr).max())) + 4+ y0 = int(np.floor((pts[:, 1] - rr).min())) - 3; y1 = int(np.ceil((pts[:, 1] + rr).max())) + 4+ ss = 2+ im = Image.new('L', ((x1 - x0) * ss, (y1 - y0) * ss), 0)+ dr = ImageDraw.Draw(im)+ q = self._r(seed)+ for (x, y), a in zip(pts, rr):+ ax, ay = a * (1 + 0.15 * q.standard_normal()), a * (1 + 0.15 * q.standard_normal())+ dr.ellipse([((x - ax) - x0) * ss, ((y - ay) - y0) * ss, ((x + ax) - x0) * ss, ((y + ay) - y0) * ss],+ fill=255)+ a = np.asarray(im, np.float32).reshape(y1 - y0, ss, x1 - x0, ss).mean((1, 3)) / 255+ kw.setdefault('dry', 0.0); kw.setdefault('edge', 0.6); kw.setdefault('soft', 0.7)+ kw.setdefault('streak', 0.15); kw.setdefault('mottle', 0.0)+ self.fill(Region(y0, x0, a), colour, alpha=alpha, seed=int(q.integers(1 << 30)), **kw)++ # ================================================================== faces+ def eye_big(self, cx, cy, w, h=None, look=(0.0, 0.0), highlight=True, lid='ink', iris='black', white='white',+ lower=False, seed=None):+ """a big round black-and-white eye: a white almond, a big dark iris tucked under the upper lid, a catchlight,+ a crayon upper lid"""+ k = self.k+ h = 0.8 * w if h is None else h+ r = self._r(seed)+ t = np.linspace(0, 2 * np.pi, 72, endpoint=False)+ top = np.sin(t) < 0+ ry = np.where(top, h * 0.47, h * 0.53)+ P = np.stack([cx + w / 2 * np.cos(t), cy + ry * np.sin(t) * np.where(top, 0.92, 1.0)], 1)+ sclera = self.poly(P)+ self.fill(sclera, white, angle=0, streak=0.12, dry=0, edge=0.35, soft=0.5, mottle=0, seed=int(r.integers(1 << 30)))+ ir = 0.25 * w+ ix, iy = cx + look[0] * w * 0.22, cy - h * 0.04 + look[1] * h * 0.16+ self.fill(self.ellipse(ix, iy, ir, ir * 1.04), iris, angle=90, streak=0.15, dry=0, edge=0.35, soft=0.5,+ mottle=0, clip=sclera, seed=int(r.integers(1 << 30)))+ if highlight:+ self.fill(self.ellipse(ix - ir * 0.33, iy - ir * 0.36, ir * 0.24), 'white', dry=0, edge=0.25, soft=0.4,+ streak=0, mottle=0, seed=int(r.integers(1 << 30)))+ if lid:+ a = np.linspace(np.pi * 1.04, np.pi * 1.96, 16)+ path = np.stack([cx + w / 2 * 1.04 * np.cos(a), cy + h * 0.47 * np.sin(a) * 0.95], 1)+ self.crayon(path, max(2.2 * k, 0.085 * w), lid, taper=(0.25, 0.12), wobble=0.4, seed=int(r.integers(1 << 30)))+ if lower:+ a = np.linspace(np.pi * 0.25, np.pi * 0.75, 10)+ path = np.stack([cx + w / 2 * np.cos(a), cy + h * 0.55 * np.sin(a)], 1)+ self.crayon(path, max(1.4 * k, 0.03 * w), lid, taper=(0.4, 0.4), alpha=0.5, wobble=0.3)++ def eye_dot(self, cx, cy, r, colour='black', highlight=True):+ self.fill(self.ellipse(cx, cy, r * 0.86, r), colour, angle=90, streak=0.1, dry=0, edge=0.3, soft=0.4, mottle=0)+ if highlight and r > 4 * self.k:+ self.fill(self.ellipse(cx - r * 0.3, cy - r * 0.38, r * 0.26), 'white', dry=0, edge=0.2, soft=0.3,+ streak=0, mottle=0)++ def cheek(self, cx, cy, r, colour='cheek', alpha=0.85):+ self.fill(self.ellipse(cx, cy, r, r * 0.9), colour, angle=-30, streak=0.25, dry=0.25, dry_px=r * 0.3,+ edge=1.0, soft=1.6, mottle=0, alpha=alpha)++ def nose(self, cx, cy, size, kind='button', colour='nose', facing=0.0):+ """'button' a small oval, 'tri' an upward triangle (a carrot nose), 'line' a crayon line with a flick, 'dot'"""+ if kind == 'button':+ self.fill(self.ellipse(cx, cy, size * 0.55, size * 0.42), colour, dry=0, edge=0.5, soft=0.6, streak=0.15)+ elif kind == 'dot':+ self.fill(self.ellipse(cx, cy, size * 0.3), colour, dry=0, edge=0.4, soft=0.5, streak=0)+ elif kind == 'tri':+ self.fill(self.poly([(cx - size * 0.42, cy + size * 0.5), (cx + size * 0.42, cy + size * 0.5),+ (cx + facing * size * 0.15, cy - size * 1.1)], smooth=False), colour, angle=90,+ dry=0.1, dry_px=size * 0.2, edge=0.6, soft=0.6, streak=0.3)+ elif kind == 'line':+ f = 1 if facing >= 0 else -1+ self.crayon([(cx, cy - size * 1.6), (cx + f * size * 0.1, cy - size * 0.5), (cx + f * size * 0.15, cy),+ (cx - f * size * 0.25, cy + size * 0.2)], size * 0.2, colour, taper=(0.3, 0.2))++ def mouth(self, cx, cy, w, kind='smile', colour='ink', lip='lip'):+ """'smile' a small crayon arc, 'lips' a small coral mouth, 'o' a little round open mouth, 'open' a happy+ open mouth"""+ k = self.k+ if kind == 'smile':+ a = np.linspace(0.15 * np.pi, 0.85 * np.pi, 12)+ self.crayon(np.stack([cx + w / 2 * np.cos(a), cy - w * 0.12 + w * 0.3 * np.sin(a)], 1),+ max(2.0 * k, 0.11 * w), colour, taper=(0.3, 0.3), wobble=0.3)+ elif kind == 'lips':+ P = [(cx - w / 2, cy), (cx - w * 0.2, cy - w * 0.16), (cx, cy - w * 0.1), (cx + w * 0.2, cy - w * 0.16),+ (cx + w / 2, cy), (cx + w * 0.15, cy + w * 0.2), (cx - w * 0.15, cy + w * 0.2)]+ self.fill(self.poly(P, smooth=True), lip, dry=0, edge=0.5, soft=0.5, streak=0.2)+ elif kind == 'o':+ self.fill(self.ellipse(cx, cy, w * 0.28, w * 0.34), 'brick', dry=0, edge=0.4, soft=0.5, streak=0.1)+ elif kind == 'open':+ a = np.linspace(0, np.pi, 16)+ P = np.vstack([[(cx - w / 2, cy - w * 0.05), (cx + w / 2, cy - w * 0.05)],+ np.stack([cx + w / 2 * np.cos(a), cy - w * 0.05 + w * 0.45 * np.sin(a)], 1)[1:-1]])+ m = self.poly(P)+ self.fill(m, 'brick', dry=0, edge=0.4, soft=0.5, streak=0.1)+ self.fill(self.ellipse(cx, cy + w * 0.28, w * 0.24, w * 0.12), 'tomato', clip=m, dry=0, edge=0.3,+ soft=0.4, streak=0)++ def brow(self, cx, cy, w, tilt=0.0, colour='brown', width=None):+ k = self.k+ a = np.deg2rad(tilt)+ d = np.array([np.cos(a), np.sin(a)]) * w / 2+ mid = np.array([cx, cy - w * 0.08])+ self.crayon([np.array([cx, cy]) - d, mid, np.array([cx, cy]) + d], width or max(2.5 * k, 0.16 * w), colour,+ taper=(0.2, 0.35), wobble=0.4)++ def face(self, cx, cy, r, turn=0.0, eyes='dot', look=(0.0, 0.0), skin='skin', cheeks=True, mouth='smile',+ nose='button', brows=False, ears=True, eye_size=1.0, seed=None):+ """a sweet face (head radius r; turn -1..1 swings the features left / right). Returns anchors: chin, top,+ eyes, nose, mouth, ears"""+ k = self.k+ rr = self._r(seed)+ fx = cx + turn * 0.26 * r+ out = dict(top=(cx, cy - r * 1.04), chin=(fx, cy + r * 1.0))+ if ears:+ for side in (-1, 1):+ if turn * side > 0.35: continue+ ex = cx + side * r * (0.96 - 0.22 * max(0.0, -turn * side))+ self.fill(self.ellipse(ex, cy + 0.12 * r, 0.2 * r, 0.24 * r), skin, dry=0, edge=0.6, soft=0.7,+ streak=0.15, lo=hexc(skin) * 0.95)+ self.fill(self.ellipse(ex + side * 0.03 * r, cy + 0.12 * r, 0.09 * r, 0.12 * r), 'skin_shade',+ dry=0, edge=0.5, soft=0.6, streak=0, alpha=0.7)+ t = np.linspace(0, 2 * np.pi, 120, endpoint=False)+ sx = np.where(np.sin(t) > 0, 1.0 - 0.06 * np.sin(t) ** 2, 1.0)+ P = np.stack([cx + r * np.cos(t) * sx, cy + r * 1.02 * np.sin(t)], 1)+ head = self.poly(P)+ self.fill(head, skin, angle=80, streak=0.22, dry=0.15, dry_px=r * 0.15, edge=0.8, soft=0.9,+ seed=int(rr.integers(1 << 30)))+ out['head'] = head+ sp = 0.37 * r * (1 - 0.22 * abs(turn))+ ey = cy + 0.06 * r+ E = []+ for side in (-1, 1):+ far = turn * side < -0.1+ sc = (1 - 0.18 * abs(turn)) if far else 1.0+ ex = fx + side * sp * (0.85 if far else 1.0)+ E.append((ex, ey))+ if eyes == 'big':+ self.eye_big(ex, ey, 0.36 * r * eye_size * sc, 0.3 * r * eye_size, look=look,+ seed=int(rr.integers(1 << 30)))+ elif eyes == 'dot':+ self.eye_dot(ex + look[0] * 0.03 * r, ey + look[1] * 0.03 * r, 0.085 * r * eye_size * sc)+ elif eyes == 'closed':+ a = np.linspace(0.1 * np.pi, 0.9 * np.pi, 10)+ self.crayon(np.stack([ex + 0.11 * r * np.cos(a), ey - 0.02 * r + 0.07 * r * np.sin(a)], 1),+ max(2.0 * k, 0.035 * r), 'ink', taper=(0.3, 0.3), wobble=0.2)+ if brows:+ self.brow(ex, ey - (0.3 if eyes == 'big' else 0.2) * r, 0.24 * r * sc, tilt=-side * 6,+ colour='brown')+ out['eyes'] = E+ if cheeks:+ for side in (-1, 1):+ far = turn * side < -0.1+ ccx = fx + side * (0.56 * r if not far else 0.46 * r)+ self.cheek(ccx, cy + 0.36 * r, 0.17 * r * (0.85 if far else 1.0), alpha=0.8)+ ny = cy + 0.27 * r+ nx = fx + turn * 0.1 * r+ if nose: self.nose(nx, ny, 0.12 * r, nose, facing=turn)+ out['nose'] = (nx, ny)+ my = cy + 0.5 * r+ if mouth: self.mouth(fx + turn * 0.05 * r, my, 0.2 * r, mouth)+ out['mouth'] = (fx, my)+ return out++ def hair(self, cx, cy, r, style='bob', colour='hair', turn=0.0, layer='back', length=1.0, strands=True,+ seed=None):+ """hair as one big grainy shape behind the head ('back') and a fringe / side locks in front ('front').+ styles: 'bob', 'long' (middle part, past the shoulders), 'short', 'bun'"""+ k = self.k+ rr = self._r(seed)+ sd = int(rr.integers(1 << 30))+ kw = dict(angle=90, streak=0.3, dry=0.2, dry_px=r * 0.1, edge=1.2, soft=1.0, mottle=0.1)+ if layer == 'back':+ if style in ('bob', 'bun'):+ bot = cy + 0.72 * r * length+ P = [(cx - 1.12 * r, bot), (cx - 1.16 * r, cy), (cx - 0.95 * r, cy - 0.85 * r), (cx, cy - 1.18 * r),+ (cx + 0.95 * r, cy - 0.85 * r), (cx + 1.16 * r, cy), (cx + 1.12 * r, bot)]+ self.fill(self.poly(P, smooth=True) | self.rect(cx - 1.13 * r, cy, cx + 1.13 * r, bot), colour,+ seed=sd, **kw)+ if style == 'bun':+ self.fill(self.blob(cx - turn * 0.3 * r, cy - 1.25 * r, 0.42 * r, 0.38 * r, rough=0.05), colour,+ seed=sd + 1, **kw)+ elif style == 'long':+ # the mass falls behind the shoulders: wider and longer on the back side of a turned head+ t = np.linspace(np.pi, 2 * np.pi, 24)+ topc = np.stack([cx + 1.08 * r * np.cos(t), cy - 0.05 * r + 1.12 * r * np.sin(t)], 1)+ wR = 1.12 + 0.3 * max(0.0, -turn); wL = 1.12 + 0.3 * max(0.0, turn)+ bR = cy + (1.9 + 0.5 * max(0.0, -turn)) * r * length+ bL = cy + (1.9 + 0.5 * max(0.0, turn)) * r * length+ ends = []+ for i in range(9):+ u = i / 8+ xe = cx + wR * 1.08 * r - (wR + wL) * 1.08 * r * u+ ye = bR * (1 - u) + bL * u - (0.16 * r if i % 2 else 0.0) - 0.18 * r * np.sin(np.pi * u) ** 2+ ends.append((xe, ye))+ P = np.vstack([topc, [(cx + wR * r, cy + 0.4 * r), (cx + wR * 1.06 * r, cy + 1.2 * r)], ends,+ [(cx - wL * 1.06 * r, cy + 1.2 * r), (cx - wL * r, cy + 0.4 * r)]])+ self.fill(self.poly(P), colour, seed=sd, **kw)+ if strands:+ for i in range(4):+ side = -1 if i % 2 else 1+ wq = wR if side > 0 else wL+ bq = bR if side > 0 else bL+ x0 = cx + side * (wq - 0.1) * r+ self.crayon([(x0, cy - 0.2 * r), (x0 + side * 0.18 * r, cy + 0.9 * r),+ (x0 + side * (0.3 + 0.08 * i) * r, bq + (0.05 * i) * r)],+ max(1.4 * k, 0.011 * r), colour, taper=(0.1, 0.6), alpha=0.85, seed=sd + i)+ elif style == 'short':+ P = [(cx - 1.06 * r, cy + 0.1 * r), (cx - 1.0 * r, cy - 0.7 * r), (cx, cy - 1.16 * r),+ (cx + 1.0 * r, cy - 0.7 * r), (cx + 1.06 * r, cy + 0.1 * r), (cx, cy - 0.2 * r)]+ self.fill(self.poly(P, smooth=True), colour, seed=sd, **kw)+ return+ # front: the fringe and side locks over the face+ fx = cx + turn * 0.26 * r+ if style in ('bob', 'bun', 'short'):+ line = cy - (0.42 if style != 'short' else 0.5) * r+ part = fx - 0.25 * r * (1 if turn >= 0 else -1)+ t = np.linspace(np.pi * 1.02, np.pi * 1.98, 40)+ cap = np.stack([cx + 1.06 * r * np.cos(t), cy - 0.05 * r + 1.1 * r * np.sin(t)], 1)+ fr = np.array([(cx + 1.06 * r, line + 0.3 * r), (fx + 0.55 * r, line + 0.02 * r), (part + 0.15 * r, line - 0.1 * r),+ (part, line - 0.28 * r), (part - 0.2 * r, line - 0.05 * r), (fx - 0.6 * r, line + 0.05 * r),+ (cx - 1.06 * r, line + 0.32 * r)])+ self.fill(self.poly(np.vstack([cap, fr]), smooth=True), colour, seed=sd, **kw)+ if style in ('bob', 'bun'):+ for side in (-1, 1):+ if turn * side > 0.4: continue+ ox = cx + side * 1.12 * r+ ix = cx + side * (0.84 - 0.1 * max(0, -turn * side)) * r+ P = [(ox, line - 0.1 * r), (ix, line + 0.2 * r), (ix + side * 0.04 * r, cy + 0.55 * r),+ (ix + side * 0.1 * r, cy + 0.72 * r * length), (ox, cy + 0.74 * r * length)]+ self.fill(self.poly(P), colour, seed=sd + 2 + side, **kw)+ elif style == 'long':+ px, py = fx - 0.05 * r, cy - 1.1 * r+ for side in (-1, 1):+ P = [(px, py), (px + side * 0.12 * r, cy - 0.85 * r), (px + side * 0.55 * r, cy - 0.5 * r),+ (fx + side * 0.86 * r, cy - 0.05 * r), (fx + side * 0.9 * r, cy + 0.7 * r),+ (cx + side * 1.25 * r, cy + 0.9 * r), (cx + side * 1.15 * r, cy - 0.7 * r),+ (px + side * 0.4 * r, py - 0.02 * r)]+ self.fill(self.poly(P, smooth=True), colour, seed=sd + 3 + side, **kw)++ def beanie(self, cx, cy, r, colour='cream', band=None, pompom=True, turn=0.0, seed=None):+ """a knitted hat over the top of a head (band at the forehead, rib dashes, a pompom)"""+ k = self.k+ rr = self._r(seed)+ band = band or colour+ line = cy - 0.36 * r+ t = np.linspace(np.pi, 2 * np.pi, 40)+ dome = np.stack([cx + 1.1 * r * np.cos(t), line - 0.02 * r + 1.0 * r * np.sin(t) * 0.98], 1)+ dome = np.vstack([dome, [(cx + 1.1 * r, line + 0.05 * r), (cx - 1.1 * r, line + 0.05 * r)]])+ self.fill(self.poly(dome), colour, angle=90, streak=0.3, dry=0.2, dry_px=r * 0.1, edge=1.0,+ seed=int(rr.integers(1 << 30)))+ bnd = self.poly([(cx - 1.16 * r, line - 0.24 * r), (cx, line - 0.3 * r), (cx + 1.16 * r, line - 0.24 * r),+ (cx + 1.14 * r, line + 0.12 * r), (cx, line + 0.18 * r), (cx - 1.14 * r, line + 0.12 * r)],+ smooth=True)+ self.fill(bnd, band, angle=0, streak=0.3, dry=0.15, dry_px=r * 0.06, edge=1.0, lo=hexc(band) * 0.86,+ seed=int(rr.integers(1 << 30)))+ for i in range(9):+ x = cx + (i - 4) * 0.24 * r + turn * 0.1 * r+ self.crayon([(x, line - 0.2 * r), (x, line + 0.1 * r)], max(1.6 * k, 0.03 * r),+ hexc(band) * 0.78, taper=(0.3, 0.3), alpha=0.7, wobble=0.3)+ if pompom:+ self.fill(self.blob(cx + turn * 0.15 * r, line - 1.1 * r, 0.3 * r, 0.28 * r, rough=0.12), band, angle=60,+ streak=0.4, dry=0.3, dry_px=r * 0.06, edge=1.8, soft=1.4, seed=int(rr.integers(1 << 30)))++ # ================================================================== figures+ def limb(self, path, w0, w1=None, colour='vermilion', angle=None, **kw):+ """an arm or a leg: a soft tube"""+ P = np.asarray(path, np.float32)+ if angle is None:+ d = P[-1] - P[0]; angle = float(np.degrees(np.arctan2(d[1], d[0])))+ kw.setdefault('dry', 0.15); kw.setdefault('dry_px', w0 * 0.2); kw.setdefault('streak', 0.3)+ self.fill(self.tube(P, w0, w1), colour, angle=angle, **kw)++ def mitten(self, x, y, r, colour='pine_mid', angle=90.0, thumb=1):+ a = np.deg2rad(angle)+ self.fill(self.blob(x, y, r * 0.95, r * 1.1, rough=0.04, rot=a - np.pi / 2), colour, angle=angle, dry=0,+ edge=0.7, soft=0.7, streak=0.25)+ if thumb:+ tx = x + np.cos(a + thumb * 1.2) * r * 0.75; ty = y + np.sin(a + thumb * 1.2) * r * 0.75+ self.fill(self.ellipse(tx, ty, r * 0.38, r * 0.48, rot=np.degrees(a)), colour, dry=0, edge=0.6, soft=0.6,+ streak=0.2)++ def boot(self, x, y, w, colour='black', facing=1):+ """a little boot standing at (x, y) (the sole), toe toward `facing`"""+ f = facing+ P = [(x - f * 0.42 * w, y), (x - f * 0.42 * w, y - 0.75 * w), (x + f * 0.12 * w, y - 0.75 * w),+ (x + f * 0.2 * w, y - 0.38 * w), (x + f * 0.58 * w, y - 0.3 * w), (x + f * 0.62 * w, y - 0.05 * w),+ (x + f * 0.5 * w, y + 0.02 * w)]+ self.fill(self.poly(P, smooth=True), colour, angle=0, dry=0.05, dry_px=w * 0.1, edge=0.7, soft=0.7,+ streak=0.25)++ POSES = {+ # joints in units of the figure's height h, origin on the ground between the feet, facing right+ 'stand': dict(sh_n=(0.115, -0.66), sh_f=(-0.115, -0.66), el_n=(0.16, -0.52), el_f=(-0.16, -0.52),+ wr_n=(0.17, -0.40), wr_f=(-0.17, -0.40), hip_n=(0.06, -0.30), hip_f=(-0.06, -0.30),+ kn_n=(0.065, -0.17), kn_f=(-0.065, -0.17), an_n=(0.07, -0.035), an_f=(-0.07, -0.035),+ head=(0.0, -0.835), lean=0.0),+ 'walk': dict(sh_n=(0.11, -0.66), sh_f=(-0.11, -0.66), el_n=(0.19, -0.54), el_f=(-0.17, -0.55),+ wr_n=(0.27, -0.45), wr_f=(-0.22, -0.43), hip_n=(0.05, -0.30), hip_f=(-0.05, -0.30),+ kn_n=(0.11, -0.17), kn_f=(-0.07, -0.16), an_n=(0.15, -0.04), an_f=(-0.13, -0.06),+ head=(0.015, -0.835), lean=0.0),+ # sitting on an edge (x, y = the seat under the hips), legs hanging over it+ 'sit': dict(sh_n=(0.11, -0.40), sh_f=(-0.11, -0.40), el_n=(0.17, -0.27), el_f=(-0.15, -0.27),+ wr_n=(0.2, -0.15), wr_f=(-0.16, -0.15), hip_n=(0.03, -0.04), hip_f=(-0.02, -0.04),+ kn_n=(0.22, -0.035), kn_f=(0.18, -0.045), an_n=(0.25, 0.17), an_f=(0.19, 0.15),+ head=(0.015, -0.575), lean=0.0),+ }++ def child(self, x, y, h, facing=1, pose='stand', outfit=None, hooks=None, **joints):+ """a picture-book child about h px tall standing on (x, y). outfit keys: coat, sleeve, legs, boots, hair,+ hair_style, hat, hat_band, scarf, mittens, skin, eyes, mouth, nose, turn, look, collar, buttons, dress+ (a hem below the coat), hem (coat length, 0..1). pose 'stand' / 'walk' (x, y on the ground between the+ feet) or 'sit' (x, y on the seat edge under the hips, legs hanging). hooks: callables run at 'behind',+ 'hand_far', 'before_head', 'hand_near', 'end'. joints override POSES entries (units of h). Returns pixel+ joints."""+ o = dict(coat='vermilion', sleeve=None, legs='brick', boots='black', hair='hair', hair_style='bob', hat=None,+ hat_band=None, scarf=None, mittens='pine_mid', skin='skin', eyes='dot', mouth='smile',+ nose='button', turn=0.35 * facing, look=(0.4 * facing, 0.0), collar=None, buttons='cream',+ dress=None, hem=1.0, brows=False, hair_len=1.0, eye_size=1.0)+ o.update(outfit or {})+ hooks = hooks or {}+ J0 = dict(self.POSES[pose]); J0.update(joints)+ f = facing+ J = {kk: (x + f * v[0] * h, y + v[1] * h) for kk, v in J0.items() if kk != 'lean'}+ sleeve = o['sleeve'] or (hexc(o['coat']) * 0.86)+ k = self.k+ if 'behind' in hooks: hooks['behind']()+ aw = 0.075 * h+ # far arm (behind the coat), far leg, near leg+ self.limb([J['sh_f'], J['el_f'], J['wr_f']], aw, aw * 0.85, sleeve)+ if o['mittens']: self.mitten(*J['wr_f'], 0.04 * h, o['mittens'], angle=90 - f * 20, thumb=f)+ if 'hand_far' in hooks: hooks['hand_far']()+ lw = 0.062 * h+ for s in ('f', 'n'):+ col = o['legs'] if s == 'n' else hexc(o['legs']) * 0.85+ self.limb([J['hip_' + s], J['kn_' + s], J['an_' + s]], lw, lw * 0.9, col)+ bx, by = J['an_' + s]+ self.boot(bx + f * 0.01 * h, by + 0.035 * h, 0.105 * h,+ o['boots'] if s == 'n' else hexc(o['boots']) * 0.85 + 0.02, facing=f)+ # the coat: an A-line from the shoulders to the hem+ sh_y = (J['sh_n'][1] + J['sh_f'][1]) / 2+ cx0 = (J['sh_n'][0] + J['sh_f'][0]) / 2+ hem_y = y - (0.27 + 0.1 * (1 - o['hem'])) * h if pose != 'sit' else y + 0.005 * h+ sw, hw = 0.13 * h, 0.235 * h+ neck_y = sh_y - 0.025 * h+ if o['dress']:+ self.fill(self.poly([(cx0 - hw * 0.95, hem_y - 0.05 * h), (cx0 + hw * 0.95, hem_y - 0.05 * h),+ (cx0 + hw * 1.02, hem_y + 0.05 * h), (cx0 - hw * 1.02, hem_y + 0.05 * h)]),+ o['dress'], angle=0, streak=0.3, dry=0.1, dry_px=0.01 * h)+ P = [(cx0 - 0.045 * h, neck_y), (cx0 - sw * 0.85, sh_y - 0.005 * h), (cx0 - sw * 1.05, sh_y + 0.04 * h),+ (cx0 - sw * 1.15, sh_y + 0.12 * h), (cx0 - hw, hem_y - 0.01 * h), (cx0 - hw * 0.3, hem_y + 0.012 * h),+ (cx0 + hw * 0.3, hem_y + 0.012 * h), (cx0 + hw, hem_y - 0.01 * h), (cx0 + sw * 1.15, sh_y + 0.12 * h),+ (cx0 + sw * 1.05, sh_y + 0.04 * h), (cx0 + sw * 0.85, sh_y - 0.005 * h), (cx0 + 0.045 * h, neck_y)]+ coat = self.poly(P, smooth=True)+ self.fill(coat, o['coat'], angle=88, streak=0.35, dry=0.2, dry_px=0.02 * h)+ J['coat'] = coat+ J['hem'] = (cx0, hem_y)+ if o['buttons']:+ for i in range(3):+ self.dots([(cx0 + f * 0.012 * h, sh_y + (0.07 + i * 0.075) * h)], 0.011 * h, o['buttons'])+ if o['collar']:+ for s in (-1, 1):+ self.fill(self.poly([(cx0, neck_y + 0.04 * h), (cx0 + s * 0.085 * h, neck_y - 0.005 * h),+ (cx0 + s * 0.1 * h, neck_y + 0.045 * h)]), o['collar'], dry=0, edge=0.7)+ if o['scarf']:+ sc = o['scarf']+ self.fill(self.blob(cx0, neck_y + 0.01 * h, 0.1 * h, 0.035 * h, rough=0.05), sc, angle=0, streak=0.35,+ dry=0.1, dry_px=0.008 * h)+ tail = [(cx0 + f * 0.03 * h, neck_y + 0.02 * h), (cx0 + f * 0.05 * h, neck_y + 0.1 * h),+ (cx0 + f * 0.055 * h, neck_y + 0.17 * h)]+ if pose == 'walk':+ tail = [(cx0 - f * 0.06 * h, neck_y + 0.015 * h), (cx0 - f * 0.13 * h, neck_y + 0.05 * h),+ (cx0 - f * 0.17 * h, neck_y + 0.13 * h)]+ self.fill(self.tube(tail, 0.05 * h, 0.045 * h), sc, angle=90 if pose != 'walk' else 60, streak=0.35,+ dry=0.1, dry_px=0.008 * h, lo=hexc(sc) * 0.9)+ end = np.array(tail[-1]); d = end - np.array(tail[-2]); d = d / (np.linalg.norm(d) + 1e-6)+ nrm = np.array([-d[1], d[0]])+ for i in range(-2, 3):+ p0 = end + nrm * i * 0.009 * h+ self.crayon([p0, p0 + d * 0.025 * h], max(1.5 * k, 0.006 * h), hexc(sc) * 0.9, taper=(0, 0.5))+ if 'before_head' in hooks: hooks['before_head']()+ # near arm over the coat+ self.limb([J['sh_n'], J['el_n'], J['wr_n']], aw, aw * 0.85, sleeve)+ self.shadow(self.tube([J['sh_n'], J['el_n'], J['wr_n']], aw * 1.25, aw * 1.05) - self.tube(+ [J['sh_n'], J['el_n'], J['wr_n']], aw * 0.95, aw * 0.8), 'shadow', depth=0.5, edge=0.6)+ if o['mittens']: self.mitten(*J['wr_n'], 0.04 * h, o['mittens'], angle=90 + f * 10, thumb=-f)+ if 'hand_near' in hooks: hooks['hand_near']()+ # the head+ hx, hy = J['head']+ r = 0.135 * h+ J['r'] = r+ self.fill(self.tube([(cx0, neck_y + 0.015 * h), (hx, hy + 0.75 * r)], 0.07 * h), o['skin'], angle=90, dry=0,+ edge=0.5, lo=hexc(o['skin']) * 0.93)+ self.hair(hx, hy, r, o['hair_style'], o['hair'], o['turn'], 'back', length=o['hair_len'])+ F = self.face(hx, hy, r, turn=o['turn'], eyes=o['eyes'], look=o['look'], skin=o['skin'], mouth=o['mouth'],+ nose=o['nose'], brows=o['brows'], ears=True, eye_size=o['eye_size'])+ self.hair(hx, hy, r, o['hair_style'], o['hair'], o['turn'], 'front', length=o['hair_len'])+ if o['hat']: self.beanie(hx, hy, r, o['hat'], o['hat_band'], turn=o['turn'])+ J['face'] = F+ if 'end' in hooks: hooks['end']()+ return J++ # ================================================================== props+ def house(self, x, y, w, h, wall='vermilion', side=None, roof='snow_light', snow=True, depth=None,+ window='window', door='brick', chimney='brick', windows=None, seed=None):+ """a little gabled cottage: the gable end (x .. x + w, ground y, wall height h) and a side wall running off to+ the left (depth px) under a snowy roof. Returns anchors (apex, chimney top, windows)"""+ k = self.k+ rr = self._r(seed)+ side = side or hexc(wall) * 0.8+ d = 0.9 * w if depth is None else depth+ apex = (x + w / 2, y - h - 0.62 * w)+ e = 0.07 * w+ # side wall and its roof+ self.fill(self.rect(x - d, y - h, x + 2, y), side, angle=88, streak=0.35, dry=0.15, seed=int(rr.integers(1 << 30)))+ self.fill(self.rect(x, y - h, x + w, y) | self.poly([(x, y - h + 2), apex, (x + w, y - h + 2)]), wall,+ angle=80, streak=0.35, dry=0.15, seed=int(rr.integers(1 << 30)))+ roofP = [(apex[0], apex[1] - 0.02 * w), (x - e, y - h + 0.02 * w), (x - e - d, y - h + 0.02 * w),+ (apex[0] - d, apex[1] - 0.02 * w)]+ out = dict(apex=apex)+ # chimney (behind the snow lip) on the roof+ cxm = apex[0] - d * 0.62+ top = apex[1] - 0.18 * w+ self.fill(self.rect(cxm - 0.09 * w, top, cxm + 0.09 * w, apex[1] + 0.25 * w), chimney, angle=90, streak=0.3,+ dry=0.05, dry_px=4 * k, seed=int(rr.integers(1 << 30)))+ self.fill(self.rect(cxm - 0.105 * w, top - 0.03 * w, cxm + 0.105 * w, top + 0.02 * w), hexc(chimney) * 0.85,+ dry=0, edge=0.6)+ out['chimney'] = (cxm, top - 0.03 * w)+ self.fill(self.poly(roofP), roof if snow else hexc(wall) * 0.7, angle=-35, streak=0.45, dry=0.25,+ dry_px=0.03 * w, mottle=0.25, seed=int(rr.integers(1 << 30)))+ if snow:+ self.mottle(self.poly(roofP), 'snow', scale=0.25 * w, cover=0.3, angle=-35, streak=0.4)+ # the snow lip along the eaves, hanging a little+ xs = np.linspace(x - e - d, x - e, 30)+ ys = y - h + 0.02 * w + 0.025 * w + 0.012 * w * np.sin(xs * 0.05)+ P = np.vstack([np.stack([xs, ys - 0.04 * w], 1), np.stack([xs[::-1], ys[::-1] + 0.015 * w], 1)])+ self.fill(self.poly(P), 'white', angle=0, streak=0.3, dry=0.1, dry_px=3 * k)+ # the bargeboard (snow on the gable edges)+ for a, b in ((apex, (x - e, y - h + 0.02 * w)), (apex, (x + w + e, y - h + 0.02 * w))):+ self.brush([a, b], 0.075 * w, roof if snow else hexc(wall) * 0.7, taper=(0.02, 0.02), dry=0.1, streak=0.4)+ if snow:+ self.scumble(self.tube([apex, (x + w + e, y - h + 0.02 * w)], 0.07 * w), 'white', angle=-30, cover=0.55)+ # windows: two on the gable end, one in the gable, one on the side wall; a door on the side+ W_ = windows or [(x + 0.18 * w, y - 0.78 * h, 0.24 * w, 0.32 * h), (x + 0.58 * w, y - 0.78 * h, 0.24 * w, 0.32 * h),+ (x + 0.4 * w, y - h - 0.32 * w, 0.2 * w, 0.18 * w), (x - 0.72 * d, y - 0.8 * h, 0.22 * w, 0.3 * h)]+ out['windows'] = []+ for (wx, wy, ww, wh) in W_:+ reg = self.rect(wx, wy, wx + ww, wy + wh)+ self.fill(reg, window, angle=90, streak=0.3, dry=0.05, dry_px=3 * k, edge=0.6,+ hi='lamp', lo='gold', mottle=0.3)+ self.mottle(reg, 'orange_light', scale=ww * 0.6, cover=0.25, edge=0.6, soft=1, streak=0.2, dry=0.2)+ bw = max(2.5 * k, 0.045 * ww + 2 * k)+ self.crayon([(wx + ww / 2, wy + 2), (wx + ww / 2, wy + wh - 2)], bw, 'brown', taper=(0.05, 0.05))+ self.crayon([(wx + 2, wy + wh * 0.48), (wx + ww - 2, wy + wh * 0.48)], bw, 'brown', taper=(0.05, 0.05))+ out['windows'].append((wx + ww / 2, wy + wh / 2, ww, wh))+ if door:+ dx = x - 0.32 * d+ self.fill(self.rect(dx - 0.13 * w, y - 0.62 * h, dx + 0.13 * w, y + 2), door, angle=90, streak=0.35,+ dry=0.05, dry_px=3 * k)+ self.dots([(dx + 0.08 * w, y - 0.3 * h)], 0.018 * w, 'mustard')+ return out++ def pine(self, x, y, h, w=None, colour='pine', light='pine_mid', tiers=None, snow=None, lean=0.0, seed=None):+ """a wild, feathery pine: a trunk and uneven tiers of dry, tapered fronds sweeping up -- lengths jump about,+ a few are missing, the crown leans -- so it reads as a tree in a wood, not a tidy cone (snow= a colour for+ snow lying on the top side of some fronds)"""+ k = self.k+ rr = self._r(seed)+ w = 0.55 * h if w is None else w+ n = tiers or max(5, int(h / (40 * k)))+ self.crayon([(x, y), (x + lean * h * 0.3, y - h * 0.3)], max(4 * k, 0.04 * w), 'ink', taper=(0.0, 0.3))+ self.crayon([(x + lean * h * 0.25, y - h * 0.25), (x + lean * h * 0.6, y - h * 0.6), (x + lean * h, y - h * 0.97)],+ max(3 * k, 0.03 * w), colour, taper=(0.0, 0.6))+ for i in range(n):+ t = i / (n - 1)+ yb = y - h * (0.16 + 0.78 * t)+ xb = x + lean * h * (0.16 + 0.78 * t)+ base = w * 0.5 * (1 - t) ** 0.7 + w * 0.08+ for s in (-1, 1):+ if i < n - 2 and rr.random() < 0.14: continue+ L = base * rr.uniform(0.62, 1.22)+ up = np.deg2rad(24 + 26 * t + rr.uniform(-9, 9))+ tip = (xb + s * L * np.cos(up), yb - L * np.sin(up))+ mid = (xb + s * L * 0.5 * np.cos(up), yb - L * 0.5 * np.sin(up) + 0.05 * L)+ col = colour if rr.random() > 0.22 else light+ self.brush([(xb, yb + 0.02 * L), mid, tip], max(7 * k, 0.36 * L), col, taper=(0.15, 0.65),+ streak=0.4, dry=0.25, seed=int(rr.integers(1 << 30)))+ if rr.random() < 0.6:+ up2 = up - np.deg2rad(14 + rr.uniform(0, 10))+ tip2 = (xb + s * 0.7 * L * np.cos(up2), yb + 0.04 * L - 0.7 * L * np.sin(up2))+ self.brush([(xb, yb + 0.06 * L), tip2], max(5 * k, 0.24 * L), light if col == colour else colour,+ taper=(0.2, 0.7), streak=0.4, dry=0.3, pressure=0.92, seed=int(rr.integers(1 << 30)))+ if snow and rr.random() < 0.45:+ self.brush([(xb + s * 0.3 * L * np.cos(up), yb - 0.3 * L * np.sin(up) - 0.07 * L),+ (tip[0] - s * 0.15 * L, tip[1] - 0.03 * L)], max(3 * k, 0.08 * L), snow,+ taper=(0.3, 0.5), streak=0.3, dry=0.3, pressure=0.85)+ self.brush([(x + lean * h * 0.88, y - h * 0.88), (x + lean * h * 1.02, y - h * 1.02)], max(5 * k, 0.07 * w),+ colour, taper=(0.1, 0.7))++ def fir_far(self, x, y, h, w=None, colour='dusty', seed=None):+ """a small distant fir: one narrow, jagged spire"""+ rr = self._r(seed)+ w = 0.42 * h if w is None else w+ n = 4+ P = [(x, y - h)]+ for i in range(1, n + 1):+ t = i / n+ P += [(x + w / 2 * t, y - h + h * t * 0.92), (x + w / 2 * t * 0.55, y - h + h * t * 0.92 - 0.04 * h)]+ P = P[:-1] + [(x + w * 0.05, y), (x - w * 0.05, y)]+ L = [(2 * x - px, py) for px, py in P[1:-2][::-1]]+ self.fill(self.poly(P + L), colour, angle=90, streak=0.3, dry=0.1, dry_px=0.04 * w, seed=int(rr.integers(1 << 30)))++ def round_tree(self, x, y, h, w=None, crown='green', light='moss', trunk='brown', seed=None):+ k = self.k+ rr = self._r(seed)+ w = 0.7 * h if w is None else w+ self.limb([(x, y), (x, y - 0.5 * h)], 0.09 * w, 0.06 * w, trunk, dry=0.05)+ cx, cy = x, y - 0.62 * h+ crown_r = self.blob(cx, cy, w / 2, 0.38 * h, rough=0.08, seed=int(rr.integers(1 << 30)))+ self.fill(crown_r, crown, angle=-60, streak=0.25, dry=0.3, dry_px=0.05 * w, mottle=0.2)+ self.scumble(crown_r & self.ellipse(cx - 0.18 * w, cy - 0.12 * h, 0.32 * w, 0.24 * h), light, angle=-60,+ cover=0.55)++ def bush(self, x, y, w, h, colour='pine_mid', light=None, seed=None):+ """a rounded bush standing on (x, y): three overlapping lumps"""+ rr = self._r(seed)+ reg = self.blob(x, y - 0.45 * h, w * 0.3, h * 0.6, rough=0.1, seed=int(rr.integers(1 << 30)))+ for s in (-1, 1):+ reg = reg | self.blob(x + s * w * 0.24, y - 0.3 * h, w * 0.27, h * 0.45, rough=0.1,+ seed=int(rr.integers(1 << 30)))+ reg = reg & self.above([x - w, x + w], [y + 2, y + 2])+ self.fill(reg, colour, angle=-70, streak=0.4, dry=0.3, dry_px=0.05 * w)+ if light: self.scumble(reg, light, angle=-70, cover=0.4)++ def shrub(self, x, y, h, w=None, colour='pine_mid', light='green', snow=None, n=9, seed=None):+ """a low bush of dry fronds fanning up out of the ground (or the snow) from one base"""+ k = self.k+ rr = self._r(seed)+ w = 1.2 * h if w is None else w+ for i in range(n):+ t = i / max(n - 1, 1) - 0.5+ a = np.deg2rad(-90 + t * 150 + rr.uniform(-8, 8))+ L = h * (1 - 0.55 * abs(t) * 2 * 0.6) * rr.uniform(0.75, 1.05)+ tip = (x + np.cos(a) * L * (w / h) * 0.6, y + np.sin(a) * L)+ mid = (x + np.cos(a) * L * 0.45 * (w / h) * 0.6, y + np.sin(a) * L * 0.52 + 0.04 * L)+ col = colour if rr.random() > 0.3 else light+ self.brush([(x + t * 0.25 * w, y + 0.04 * h), mid, tip], max(6 * k, 0.26 * L), col, taper=(0.1, 0.7),+ streak=0.4, dry=0.25, seed=int(rr.integers(1 << 30)))+ if snow and rr.random() < 0.5:+ self.brush([mid, (tip[0] * 0.8 + mid[0] * 0.2, tip[1] * 0.8 + mid[1] * 0.2 - 0.04 * L)],+ max(3 * k, 0.07 * L), snow, taper=(0.3, 0.5), dry=0.3, pressure=0.85)++ def cup(self, x, y, w, colour='orange', inside='coffee', rim='cream', handle=1, light=None, steam=None, seed=None):+ """a round cup standing at (x, y) (bottom centre), w wide; a lighter dry-brushed side, a saucer-free foot"""+ k = self.k+ rr = self._r(seed)+ h = 0.72 * w+ top = y - h+ if handle:+ hx = x + handle * w * 0.48+ a = np.linspace(-0.5 * np.pi, 0.5 * np.pi, 20)+ path = np.stack([hx + handle * 0.22 * w * np.cos(a), top + 0.36 * h + 0.24 * h * np.sin(a)], 1)+ self.fill(self.tube(path, 0.08 * w), colour, angle=90, dry=0, edge=0.7)+ t = np.linspace(0, np.pi, 30)+ body = np.vstack([[(x - w / 2, top)], np.stack([x - w / 2 * np.cos(t) * (1 - 0.18 * np.sin(t) ** 3),+ top + 0.06 * h + 0.92 * h * np.sin(t) ** 0.6], 1)[1:-1][::1],+ [(x + w / 2, top)]])+ bodyR = self.poly(body)+ self.fill(bodyR, colour, angle=80, streak=0.4, dry=0.2, dry_px=0.03 * w)+ lt = light or mix(colour, 'cream', 0.4)+ self.scumble(bodyR & self.rect(x + 0.12 * w, top, x + w, y), lt, angle=80, cover=0.6)+ self.fill(self.ellipse(x, top, w / 2, 0.12 * w), rim, dry=0, edge=0.6, streak=0.3)+ self.fill(self.ellipse(x, top + 0.01 * w, w * 0.43, 0.09 * w), inside, dry=0, edge=0.5, streak=0.3)+ self.fill(self.ellipse(x, y - 0.02 * w, w * 0.22, 0.04 * w), hexc(colour) * 0.8, dry=0, edge=0.5)+ if steam:+ for i in range(3):+ self.wisp(x + (i - 1) * 0.16 * w, top - 0.12 * w, (0.55 + 0.2 * (i == 1)) * w, steam, seed=int(rr.integers(1 << 30)))++ def parcel(self, x, y, w, h, colour='cobalt_bright', top=None, string='ink', bow=True, seed=None):+ """a plain box standing at (x, y) (front bottom-left corner): a front, a lighter top and a crayon string"""+ k = self.k+ top = top or mix(colour, 'white', 0.18)+ dd = 0.18 * w+ self.fill(self.rect(x, y - h, x + w, y), colour, angle=90, streak=0.35, dry=0.15, dry_px=0.04 * w)+ self.fill(self.poly([(x, y - h), (x + dd, y - h - dd * 0.6), (x + w + dd * 0.3, y - h - dd * 0.6),+ (x + w, y - h)]), top, angle=0, streak=0.3, dry=0.05, dry_px=3 * k)+ if string:+ sw = max(2.5 * k, 0.05 * w)+ self.crayon([(x + w * 0.5, y - h), (x + w * 0.5, y)], sw, string, taper=(0.02, 0.02))+ self.crayon([(x + w * 0.5, y - h), (x + w * 0.5 + dd * 0.6, y - h - dd * 0.6)], sw, string, taper=(0, 0))+ if bow:+ bx, by = x + w * 0.5 + dd * 0.3, y - h - dd * 0.3+ for s in (-1, 1):+ a = np.linspace(0, 2 * np.pi, 20)+ self.crayon(np.stack([bx + s * 0.1 * w + s * 0.1 * w * np.cos(a), by - 0.06 * w * np.sin(a) * 1.2], 1),+ sw * 0.9, string, taper=(0, 0))++ def bag(self, x, y, w, h, colour='kraft', seed=None):+ """a paper bag standing at (x, y) (bottom centre): a folded, crumpled top and a crease"""+ k = self.k+ top = y - h+ P = [(x - w / 2, y), (x - w * 0.47, top + 0.12 * h), (x - w * 0.3, top + 0.02 * h), (x - w * 0.1, top + 0.1 * h),+ (x + w * 0.12, top), (x + w * 0.33, top + 0.08 * h), (x + w * 0.47, top + 0.1 * h), (x + w / 2, y)]+ self.fill(self.poly(P), colour, angle=90, streak=0.35, dry=0.1, dry_px=0.04 * w)+ self.fill(self.poly([(x - w * 0.48, top + 0.12 * h), (x + w * 0.48, top + 0.1 * h), (x + w * 0.49, top + 0.24 * h),+ (x - w * 0.49, top + 0.25 * h)]), hexc(colour) * 0.86, angle=0, dry=0, edge=0.6)+ self.crayon([(x + w * 0.2, top + 0.3 * h), (x + w * 0.22, y - 0.05 * h)], max(2 * k, 0.03 * w),+ hexc(colour) * 0.7, taper=(0.3, 0.3), alpha=0.7)++ def potted(self, x, y, h, pot='tomato', leaf='green', seed=None):+ rr = self._r(seed)+ pw = 0.45 * h+ self.fill(self.poly([(x - pw / 2, y - 0.38 * h), (x + pw / 2, y - 0.38 * h), (x + pw * 0.38, y),+ (x - pw * 0.38, y)]), pot, angle=90, streak=0.3, dry=0.1, dry_px=0.03 * h)+ self.fill(self.rect(x - pw * 0.56, y - 0.44 * h, x + pw * 0.56, y - 0.36 * h), hexc(pot) * 0.88, dry=0,+ edge=0.6)+ for i in range(7):+ a = np.deg2rad(-90 + (i - 3) * 22 + rr.uniform(-6, 6))+ L = h * (0.45 + 0.2 * rr.random())+ p0 = (x, y - 0.42 * h)+ self.brush([p0, (x + np.cos(a) * L * 0.5, y - 0.42 * h + np.sin(a) * L * 0.55),+ (x + np.cos(a) * L, y - 0.42 * h + np.sin(a) * L)], 0.12 * h, leaf, taper=(0.3, 0.5))++ def reeds(self, x, y, h, n=5, colour='pine_mid', head='brown', spread=None, seed=None):+ k = self.k+ rr = self._r(seed)+ spread = 0.25 * h if spread is None else spread+ for i in range(n):+ x0 = x + (i - (n - 1) / 2) * spread / max(n - 1, 1) + rr.uniform(-4, 4) * k+ hh = h * rr.uniform(0.7, 1.0)+ lean = rr.uniform(-0.12, 0.12) * hh+ self.brush([(x0, y), (x0 + lean * 0.4, y - hh * 0.5), (x0 + lean, y - hh)], max(4 * k, 0.025 * h), colour,+ taper=(0.05, 0.4), dry=0.1)+ if head and rr.random() < 0.7:+ self.fill(self.tube([(x0 + lean * 0.86, y - hh * 0.78), (x0 + lean * 0.95, y - hh * 0.93)],+ max(8 * k, 0.06 * h)), head, angle=90, dry=0, edge=0.8)+ if rr.random() < 0.6:+ s = -1 if rr.random() < 0.5 else 1+ self.brush([(x0, y - hh * 0.1), (x0 + s * 0.12 * hh, y - hh * 0.45), (x0 + s * 0.25 * hh, y - hh * 0.6)],+ max(5 * k, 0.035 * h), colour, taper=(0.05, 0.8), dry=0.1)++ def tuft(self, x, y, w, h, colour='green', n=7, seed=None):+ k = self.k+ rr = self._r(seed)+ for i in range(n):+ t = i / max(n - 1, 1) - 0.5+ x0 = x + t * w * 0.6+ tip = (x + t * w + rr.uniform(-0.05, 0.05) * w, y - h * (0.6 + 0.4 * rr.random()) * (1 - abs(t)))+ self.brush([(x0, y + 2 * k), tip], max(4 * k, 0.12 * w), colour, taper=(0.05, 0.85), dry=0.1)++ def lamp(self, x, y, h, colour='ink', light='lamp', glow=0.55, seed=None):+ k = self.k+ self.limb([(x, y), (x, y - 0.9 * h)], 0.035 * h, 0.03 * h, colour, dry=0)+ self.fill(self.poly([(x - 0.07 * h, y - 0.9 * h), (x + 0.07 * h, y - 0.9 * h), (x + 0.05 * h, y - 1.02 * h),+ (x - 0.05 * h, y - 1.02 * h)]), light, dry=0, edge=0.6)+ self.fill(self.poly([(x - 0.09 * h, y - 1.02 * h), (x + 0.09 * h, y - 1.02 * h), (x, y - 1.09 * h)]), colour,+ dry=0, edge=0.6)+ if glow: self.glow(self.ellipse(x, y - 0.96 * h, 0.28 * h), light, glow)++ def dog(self, x, y, s, facing=1, colour='orange', patch='cream', ear=None, collar='vermilion', nose='black',+ tail_up=True, seed=None):+ """a small dog trotting, standing on (x, y), about s px from tail to nose; returns anchors (collar, nose,+ head)"""+ k = self.k+ rr = self._r(seed)+ f = facing+ ear = ear or hexc(colour) * 0.78+ dark = hexc(colour) * 0.84+ P = lambda a, b: (x + f * a * s, y - b * s)+ lw = 0.1 * s+ # far legs (trotting: far front back, far hind forward)+ self.limb([P(0.2, 0.34), P(0.17, 0.17), P(0.12, 0.02)], lw, lw * 0.9, dark, dry=0)+ self.limb([P(-0.2, 0.36), P(-0.14, 0.18), P(-0.1, 0.02)], lw, lw * 0.9, dark, dry=0)+ tail = [P(-0.3, 0.46), P(-0.43, 0.58), P(-0.45, 0.74)] if tail_up else [P(-0.3, 0.4), P(-0.48, 0.34), P(-0.55, 0.24)]+ self.brush(tail, 0.1 * s, colour, taper=(0.05, 0.7), dry=0.1)+ body = self.blob(*P(-0.01, 0.43), 0.33 * s, 0.155 * s, rough=0.03, seed=int(rr.integers(1 << 30)))+ self.fill(body, colour, angle=0, streak=0.35, dry=0.15, dry_px=0.03 * s)+ # near legs (near front forward, near hind back)+ for path in ([P(0.22, 0.36), P(0.28, 0.17), P(0.33, 0.02)], [P(-0.2, 0.38), P(-0.27, 0.18), P(-0.3, 0.02)]):+ self.limb(path, lw * 1.05, lw * 0.92, colour, dry=0)+ self.fill(self.ellipse(path[-1][0] + f * 0.025 * s, path[-1][1] - 0.005 * s, 0.065 * s, 0.032 * s),+ colour, dry=0, edge=0.6)+ # neck, head, chest patch, muzzle, ear+ hx, hy = P(0.36, 0.66)+ self.fill(self.tube([P(0.2, 0.44), (hx, hy)], 0.22 * s, 0.18 * s), colour, angle=-50, dry=0.1, dry_px=0.02 * s)+ self.fill(self.blob(*P(0.27, 0.42), 0.09 * s, 0.13 * s, rough=0.05, rot=np.deg2rad(-f * 20)), patch,+ angle=80, dry=0.15, dry_px=0.015 * s, edge=1.1)+ self.fill(self.ellipse(hx, hy, 0.165 * s, 0.15 * s), colour, angle=0, dry=0.1, dry_px=0.02 * s)+ sn = self.ellipse(*P(0.51, 0.62), 0.105 * s, 0.072 * s, rot=f * 8)+ self.fill(sn, patch, dry=0.05, dry_px=0.01 * s, edge=0.7)+ self.fill(self.ellipse(*P(0.6, 0.645), 0.034 * s, 0.03 * s), nose, dry=0, edge=0.4)+ self.eye_dot(*P(0.41, 0.71), 0.027 * s)+ self.fill(self.blob(*P(0.27, 0.66), 0.07 * s, 0.13 * s, rough=0.05, rot=np.deg2rad(f * 18)), ear,+ angle=80, dry=0.05, dry_px=0.01 * s, edge=0.7)+ self.cheek(*P(0.44, 0.6), 0.033 * s, alpha=0.6)+ if collar:+ self.brush([P(0.22, 0.6), P(0.3, 0.48)], 0.05 * s, collar, taper=(0.05, 0.05), dry=0)+ return dict(collar=P(0.26, 0.54), nose=P(0.6, 0.645), head=(hx, hy))++ def duck(self, x, y, s, facing=1, colour='cream', wing=None, beak='orange', swim=True, seed=None):+ """a duck at (x, y) (the waterline / feet), s px long"""+ k = self.k+ rr = self._r(seed)+ f = facing+ wing = wing or mix(colour, 'cream_dark', 0.6)+ P = lambda a, b: (x + f * a * s, y - b * s)+ bodyP = [P(-0.5, 0.3), P(-0.38, 0.2), P(-0.1, 0.02), P(0.25, 0.02), P(0.42, 0.15), P(0.38, 0.32),+ P(0.1, 0.36), P(-0.25, 0.33)]+ body = self.poly(bodyP, smooth=True)+ if swim: body = body & self.above([x - s, x + s], [y, y])+ self.fill(body, colour, angle=0, streak=0.35, dry=0.15, dry_px=0.03 * s)+ self.fill(self.poly([P(-0.25, 0.26), P(0.15, 0.28), P(0.05, 0.14), P(-0.3, 0.17)], smooth=True), wing,+ angle=0, dry=0.05, dry_px=0.01 * s, edge=0.8)+ self.fill(self.tube([P(0.28, 0.3), P(0.32, 0.5)], 0.17 * s, 0.15 * s), colour, angle=90, dry=0.05, dry_px=0.02 * s)+ hx, hy = P(0.32, 0.56)+ self.fill(self.ellipse(hx, hy, 0.13 * s, 0.12 * s), colour, dry=0.05, dry_px=0.02 * s)+ self.fill(self.poly([P(0.4, 0.58), P(0.6, 0.53), P(0.58, 0.49), P(0.4, 0.5)], smooth=True), beak, dry=0,+ edge=0.6)+ self.eye_dot(*P(0.36, 0.59), 0.025 * s)+ self.cheek(*P(0.3, 0.52), 0.035 * s, alpha=0.55)+ return dict(head=(hx, hy))++ def fence(self, x0, x1, y, h, colour='brown', n=None, seed=None):+ k = self.k+ n = n or max(2, int((x1 - x0) / (h * 0.9)))+ for i in range(n + 1):+ x = x0 + (x1 - x0) * i / n+ self.limb([(x, y), (x, y - h)], 0.1 * h, 0.09 * h, colour, dry=0)+ for t in (0.35, 0.75):+ self.brush([(x0 - 0.05 * h, y - t * h), (x1 + 0.05 * h, y - t * h)], 0.08 * h, colour, taper=(0.02, 0.05))++ # ================================================================== sky and marks+ def snow(self, x0, y0, x1, y1, n=120, r=None, colour='cream', alpha=0.95, avoid=None, seed=None):+ """falling snow: fuzzy dots of a few sizes"""+ k = self.k+ rr = self._r(seed)+ r = (2.8 * k, 6.5 * k) if r is None else r+ pts = np.stack([rr.uniform(x0, x1, n), rr.uniform(y0, y1, n)], 1)+ rad = rr.uniform(r[0], r[1], n) ** 1.0+ self.dots(pts, rad, colour, alpha=alpha, avoid=avoid, seed=int(rr.integers(1 << 30)))++ def stars(self, x0, y0, x1, y1, n=40, colour='cream', seed=None):+ k = self.k+ rr = self._r(seed)+ pts = np.stack([rr.uniform(x0, x1, n), rr.uniform(y0, y1, n)], 1)+ self.dots(pts, rr.uniform(1.4 * k, 3.0 * k, n), colour, alpha=0.9)++ def moon(self, x, y, r, colour='cream', halo=0.35, crescent=0.0):+ """a chalky moon; crescent > 0 bites a disc out of it (0.3 a fat crescent, 0.6 a thin one)"""+ if halo: self.glow(self.ellipse(x, y, r * 1.9), colour, halo, soft=4.0, edge=2.0)+ reg = self.ellipse(x, y, r)+ if crescent: reg = reg - self.ellipse(x + crescent * r * 1.1, y - crescent * r * 0.45, r * 0.98)+ self.fill(reg, colour, angle=-40, streak=0.35, dry=0.2, dry_px=0.1 * r, mottle=0.3)+ self.mottle(reg, mix(colour, 'cream_dark', 0.6), scale=0.5 * r, cover=0.25, edge=1, soft=1.5, alpha=0.6)++ def smoke(self, x, y, h, colour='ice', n=3, drift=0.3, alpha=0.55, seed=None):+ """chalky smoke from a chimney: a few soft, round, overlapping puffs, growing, fading and drifting downwind"""+ rr = self._r(seed)+ for i in range(n):+ t = i / max(n - 1, 1)+ rad = h * (0.1 + 0.1 * t)+ cx = x + drift * h * t ** 1.2 + rr.uniform(-0.02, 0.02) * h+ cy = y - rad * 0.7 - h * 0.4 * t+ self.fill(self.blob(cx, cy, rad, rad * 0.88, rough=0.08, seed=int(rr.integers(1 << 30))), colour,+ angle=-20, streak=0.15, pressure=0.95, dry=0.7, dry_px=rad * 0.45, edge=1.6, soft=2.6,+ alpha=alpha * (1 - 0.4 * t), mottle=0, skip=0.25)++ def wisp(self, x, y, h, colour='cream', sway=None, width=None, seed=None):+ """a curl of steam: a tapered S stroke rising from (x, y)"""+ k = self.k+ rr = self._r(seed)+ sway = 0.18 * h if sway is None else sway+ width = 0.08 * h if width is None else width+ s = 1 if rr.random() < 0.5 else -1+ P = [(x, y), (x + s * sway, y - 0.3 * h), (x - s * sway * 0.6, y - 0.62 * h), (x + s * sway * 0.4, y - h)]+ self.brush(P, width, colour, taper=(0.35, 0.6), dry=0.2, pressure=0.9, streak=0.3)++ def ripples(self, x, y, w, n=3, colour='ice', width=None, alpha=0.8, seed=None):+ """short light arcs on water around (x, y)"""+ k = self.k+ rr = self._r(seed)+ width = 3.2 * k if width is None else width+ for i in range(n):+ ww = w * (0.45 + 0.55 * (i + 1) / n)+ yy = y + i * 0.06 * w+ a = np.linspace(0.12 * np.pi, 0.88 * np.pi, 14)+ P = np.stack([x + ww / 2 * np.cos(a), yy + 0.05 * ww * np.sin(a)], 1)+ seg = rr.uniform(0.0, 0.25)+ P = P[int(seg * 14):] if rr.random() < 0.5 else P[:14 - int(seg * 14)]+ self.crayon(P, width, colour, taper=(0.3, 0.3), alpha=alpha, wobble=0.5)++ def footprints(self, pts, size, colour='snow_shade', depth=0.7):+ for (x, y) in pts:+ self.shadow(self.ellipse(x, y, size, size * 0.42), colour, depth=depth, edge=0.8, dry=0)++ # ================================================================== output+ def finish(self, grain=1.0, speckle=1.0, soft=0.25):+ """record the finishing (applied in render, so every stage snapshot matches; call before the first mark)"""+ self.fin = dict(grain=grain, speckle=speckle, soft=soft)+ return self++ def render(self):+ """the finished picture (the page buffer is untouched)"""+ C = self.C+ f = self.fin+ if not f: return np.clip(C, 0, 1)+ self._need()+ out = np.clip(C, 0, 1.0).copy()+ if f['grain']:+ out *= (1 + 0.03 * f['grain'] * self.G)[..., None]+ sp = f['speckle']+ if sp:+ lum = out.mean(-1)+ light = (self.SP < 0.005 * sp * (0.3 + 1.4 * (1 - lum))).astype(np.float32)+ dark = (self.SP > 1 - 0.0035 * sp * (0.3 + 1.4 * lum)).astype(np.float32)+ sg = 0.3 * self.k+ light = blur(light, sg) * 2.2; dark = blur(dark, sg) * 2.2+ out += (np.clip(light, 0, 1) * 0.2)[..., None] * (1.05 - out)+ out *= (1 - np.clip(dark, 0, 1) * 0.18)[..., None]+ if f['soft']:+ s = f['soft']+ for c in range(3): out[..., c] = out[..., c] * (1 - s) + blur(out[..., c], 0.7) * s+ return np.clip(out, 0, 1)++ def composite(self):+ out = self.render() * 255 + 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=92):+ 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 fh: fh.write(b)+ img.save(f'{sd}/{self._n_stages:02d}_final.png', compress_level=1)+ return img