Paint: how each part is painted
By part: hair 🧪 · skin 🧪 · eyes 🧪 · stockings ⬜ · clothing 📐 · shoes 📐 · metal and jewellery ⬜ · buildings ⬜ · trees ⬜ · sky and clouds ⬜ · water ⬜ · background ✅ · the copy-it baseline ✅ (not a way of painting) · step 6 of the layered route · one module per part, and the registry a method name resolves through: appendix B · where a person writes the choice: appendix G
What this step does
Paint the light and shade into each layer of the draft (ch. 5) by that part’s own method, then lay the background, finish and save. Three general rules: a stroke samples its colour inside its group and lands inside its group, and no stroke crosses a group boundary; the reference is the source cropped to that group’s whole shape (with the completed image where it is hidden, ch. 3); and how to paint is a question for the artist, not a decision to make for them – one method per part, written by a person into the picture’s own parts table.
Why part by part
When an artist paints a character, hair, skin, eyes, fabric and metal each get their own technique. Hair is divided into locks, one highlight band per lock with a dark seam between them. Skin is one hard-edged tier of shadow, but the face (the shadow under the fringe, the nose, the blush), the neck (a large shadow under the chin), the thighs (a cylinder’s gradient plus the hard shadow the skirt presses onto it) and the arms are each different. Eyes are a few named shapes. Fabric depends on its material, its folds being hard-edged grey shadows one after another. Metal works by a bright band and a dark one pressed right against each other. No single method paints every part – this project has been caught out three times over exactly that: cel banding applied to eyes gives a black blob; applied to hair the locks disappear; and the error-driven copy applied to everything produces a complete picture that a person looks at and says is not painting, it is an airbrush reproducing the source (ch. 19).
So this chapter has one page per part, each with the same skeleton: how an artist paints it (the value structure, the shape of the shadows, how hard the edges are, the highlights, the brushes) · what it looks like in the source · our method, with its status · which layers it creates in the .kra tree · how a person writes it into the parts table, and its knobs · the criteria · where it breaks · on origin. A part nobody has studied is a ⬜ placeholder: only “how an artist paints it” and “what has to be decided”, with an empty module in the code – choosing it passes the parts table and reports “not decided yet” when painting starts. All three parts that had been done (skin, eyes, hair) produced output a person judged a failure, so all three went back to 🧪 to be redone one at a time, hair first.
| part | page | method | status |
|---|---|---|---|
| Hair | Hair | hair | 🧪 |
| Skin: face, neck, arms, hands, thighs, calves, feet | Skin | shadow_tier | 🧪 |
| Eyes and mouth | Eyes and mouth | eye | 🧪 |
| Stockings | Stockings | stocking | ⬜ |
| Clothing: fabric, folds, frills, ribbons, patterns | Clothing | cloth | 📐 |
| Shoes | Shoes | shoe | 📐 |
| Metal and jewellery | Metal and jewellery | metal | ⬜ |
| Buildings | Buildings | building | ⬜ |
| Trees | Trees | tree | ⬜ |
| Sky and clouds | Sky and clouds | sky | ⬜ |
| Water | Water | water | ⬜ |
| Background | Background | — (the background is not a group and has no entry) | ✅ |
| the copy-it baseline | below on this page | generic | ✅ it produces a picture, but it is not a way of painting |
Inputs and outputs
| input | from |
|---|---|
| the draft’s plan, its flat strokes and its lines | draft |
| the segmentation, and one mask per word | segment |
| each group’s completed layer and the account of what was invented | complete |
| which method paints each group, which groups grow strands or get hatching, and where the close-ups are centred | the parts table |
| output | contents |
|---|---|
| the painting plan | per group: the method, the bands (shadow / deep / light, each with its outlines and its colour), whether there is a blend pass or strands, and the simulated likeness before and after; plus the close-up boxes |
| the draft’s plan, rewritten in place | the eye method replaces the eye group’s shape with the eye area the source defines |
| the strokes | one row per stroke; what kind it is decides which layer and which brush it lands on |
| the lines | weighted against this layer’s own image; the background’s own strokes travel with the painting strokes, not the lines |
| each group’s visible mask | at 1x, and mutually exclusive – this is what the per-group rulers measure inside |
| the 1x simulation | what the plan looks like before Krita ever opens |
| what Krita produced | the finished painting; a manifest that has to agree with the tree; one checkpoint per group; and the review images – each layer and each group alone, plus the close-ups |
The file names are fixed and are all in appendix F; the parts-table fields are in appendix G.
A person decides each layer’s method
One row per group in the parts table: the method’s name, taken from the list above, plus that method’s own knobs (each method’s page says what they are). One row is the default, and it is required – a group nobody listed falls back to it. The exact field name and format are in appendix G.
A misspelled method name fails the parts table, before anything runs; it used to blow up only at the moment of painting. Naming a placeholder is not a misspelling: it passes, and then reports “not decided yet” when painting starts, telling you which page to go and write.
Each group is dispatched once, and a method may produce nothing but strokes and its own entry in the painting plan, whose keys are exactly the ones the painting job understands; the job builds the layers from those keys and decides nothing itself. A new method is a new module with the same signature, one row in the registry, and its name in the parts table. No if on a group’s name is allowed in the library; every part-specific special case lives in the picture’s own parts table.
Three more decisions sit next to the method: which groups grow strands, which sub-parts the one-shot route hatches, and where the 1:1 close-ups are centred (in 8x coordinates, scaled for any other multiplier – at least the face, the neck, a hand and a foot). All four are in appendix G, with the step to rerun after changing each one; for the method itself, only paint has to run again.
The copy-it baseline
Error-driven: on a 1x simulated canvas, wherever it differs from the source by more than a threshold, a stroke starts there and follows an isochrome. Soft brushes (b) Airbrush Soft, at three scales) copy the large areas of light and shade, and then a small hard round brush (b) Basic-5, R=3, with a second pass at R=1.5 on groups dense with strands) copies the hard edges between colours back in – remove the hard brush and the group’s 1x likeness falls by 2 dB. The groups a person marked as growing strands get short tapered strands along the flow field, and the lines are coloured by weight.
It produces a complete picture, but it is not painting: there is not one named shadow shape, the hair is random strands plus airbrush, and the frills are mottled by tens of thousands of small dots. Every stroke is planned at 1x and painted four times larger, so a soft brush of radius 13 px becomes 50 px at 4x and the whole thing is necessarily blurry (its interior sharpness is half the source’s, ch. 19). It is kept as a ruler: each part’s method has to beat it on that part (the per-group rulers, ch. 7). Known fault: its pass table special-cases two groups by name, which violates “no part names in the library” – the baseline is left as it is, and that goes when each part is rewritten.
Lines: 色トレス (colour trace)
In the finished painting the lines are not black. Each line takes its colour and width from how dark what is beneath it is on its own layer’s image: the source’s pixels where visible, the completed image where invented (ch. 4’s group says which layer it is). An outline (one lying against the background) gets one weight, a thick line another, a thin one a third; a line not darker than its surroundings by line_drop is not drawn; and lines inside hair are judged more strictly, because strands are thin and pale in the source. “The darkest pixel” is looked for inside this layer only – half an outline lies over the background, and unconstrained it takes the background’s colour throughout (ch. 17, case 29). Filtering on darkness alone is a known fault of this approach: the pale lines of a skirt fold or a strand are all lost, and what survives is uniformly thick. Lines should be decided by the part’s own method (a hair line is the edge of a highlight band, a fabric line the edge of a fold), and that is in each page’s “what has to be decided”.
Brushes
One layer of the library holds the geometry of a stroke: wash to fill flat, soft to blend along an isochrome with an airbrush, hatch for short hatching, strands for tapered strands, detail for Hertzmann’s multi-scale greedy detail (used only by the one-shot route, since what it draws are dots rather than strokes), and contour_lines. The planner decides every stroke on a 1x simulated canvas, and what goes to disk is in 1x coordinates.
brushes.KIND maps a stroke kind to a Krita preset and is the only such table (the jobs each used to have a private copy, and one of them lost a row – ch. 17, case 35): kind -> (preset, width factor, layer, taper). There are twelve: soft, hatch, strand, detail, line, flat, shade, sharp, shadow, deep, light and blend. A stroke’s kind decides its preset, which layer it lands on, and whether it tapers. The width factor cannot be dropped – with the same setBrushSize(90), Airbrush paints 84 px, Bristles-5 40 px and Pencil 1 Sketch 18 px. The brush has to be round. Tapering is decided by the kind, and no single stroke may override it. Before a plan goes to disk, brushes.check() verifies that every kind has a row; and in the job, a stroke that finds no layer raises.
Painting, the tree, saving, delivery
One layer group per group: Shape (vector) -> <G>_Flat -> <G>_Shade -> the named bands (subgroups like <G>_Shadow, each a vector Shape plus a clipped Paint layer) -> <G>_Blend -> <G>_Strand -> <G>_Line; which layers are built follows which keys that group has in the painting plan. All of it is painted stroke by stroke with paintPath at 4x. The background is the bottom layer (Background). This tree is not hard-coded in Python inside the job, it is a file – readable, diffable and countable without opening Krita (appendix F).
Saving and checkpoints. A saved .kra has to open again with its layers’ blend, opacity and clip intact (measured round trips in ch. 13). The finished version saves a checkpoint .kra after each top-level group (stages/) – which does nothing for memory (ch. 18), and exists to show a person the intermediate states. The last thing it does: the darkest pixel in the whole image has to be (0,0,0), a gate against mistakes of the “the darkest pixel came from the background” kind (ch. 17).
Delivering to the artist. In the finished .kra, clip, blend, opacity, label and vector layers all survive the round trip. To change a local colour, change the Shape’s fill; to repaint an area’s texture, clear _Shade and paint over it, with the clipping still in force; to move a part, move its whole group – the occluded part is painted whole (ch. 3); and a band (Skin_Shadow) is a vector shape plus a flat layer, so changing its shape means dragging control points. Things that can also be put in, all verified to survive a round trip: one SelectionMask per part, the source as a FileLayer lying on top for comparison, and a repeated part as a CloneLayer. Things that cannot: a palette (saving one silently writes nothing) and layer styles (ch. 16). Vectors take almost no space, and a .kra‘s size is all in the paint layers’ tiles.
Knobs
parameter (paint) | default | meaning |
|---|---|---|
t_soft | 9 | the threshold at which a soft stroke starts; at 0.7 times this, a group’s tens of thousands of strokes are copying noise |
line_drop | 10 | a line not darker than its surroundings by this much, on its own layer’s image, is not drawn |
checkpoints | true | save a .kra after each top-level group |
job | true | false produces only the plan and the 1x simulation |
Each method’s own knobs are on its page.
Reviewing and overruling
The review images painting writes: the 1x composite (where you also check for black rims around the silhouette), the 1:1 close-ups, one image per group and one per layer (appendix F); plus the description count and the number of bare pixel writes from the painting journal. The per-group rulers (ch. 7): interior sharpness, at the hard edges, 1x PSNR, and the band edges. The 1x simulation can only point a direction; the numbers have to come from real painting, because the simulation and Krita sometimes move in opposite directions. Passing the numbers is not enough, a person has to look: the baseline passed all five criteria with a higher likeness than the old route, and a person looked and still called it copying (ch. 19).
Where it breaks
- Deciding how to paint on the artist’s behalf: cel banding on every part is posterize plus outlines, with the eyes a black blob; the error-driven copy on every part is a blurry photocopy.
- Removing the hard brush: PSNR falls by 2 dB.
- Painting too much: p90 rises above the source’s.
- Measuring the wrong thing: rulers whose masks are not mutually exclusive (the eyes mixed into the skin), band edges measured with a median, sharpness measured on the simulated canvas – the cases in ch. 17.
- Going by the numbers alone: the five criteria govern whether it looks like a person painted it, and cannot govern whether it is painting at all.
The pitfalls specific to a part are on its page.
Summary
- There is no universal method: one page per part, one module per part, and a person decides each layer’s in the parts table.
- The copy-it baseline produces a picture but is not painting, and is kept only as a ruler.
- An unstudied part is a placeholder first: the skeleton, how an artist paints it, and what has to be decided, with an empty module in the code.
- Lines, brushes, the tree, saving and delivery are common to all parts and are on this page.
On origin
Each group’s readings, the number of strokes in the glow, why the baseline’s output was judged a failure, and the matching-position comparison against the one-shot route: ch. 19, “The layered route” and “The two routes side by side”.