@pixerate/editor 0.255.0 → 0.256.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/paint-editor/collaboration-tools.d.cts +19 -0
- package/dist/paint-editor/collaboration-tools.d.ts +19 -0
- package/dist/paint-editor/collaboration.d.cts +180 -0
- package/dist/paint-editor/collaboration.d.ts +180 -0
- package/dist/paint-editor/controller.d.cts +54 -0
- package/dist/paint-editor/controller.d.ts +54 -0
- package/dist/paint-editor/index.cjs +738 -205
- package/dist/paint-editor/index.d.cts +2 -0
- package/dist/paint-editor/index.d.ts +2 -0
- package/dist/paint-editor/index.js +554 -21
- package/package.json +1 -1
- package/skills/pixerate-paint-editor/SKILL.md +31 -46
- package/skills/pixerate-paint-editor/references/painting-alongside.md +19 -0
package/package.json
CHANGED
|
@@ -101,58 +101,32 @@ the pitfalls, and uses the tools below.
|
|
|
101
101
|
|
|
102
102
|
## Best practices
|
|
103
103
|
|
|
104
|
-
- **Big to small, dark to light (or light to dark), one decision per layer.** Name layers by
|
|
105
|
-
|
|
106
|
-
- **
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
- **
|
|
110
|
-
ink or brush pen: velocity dynamics thin fast strokes. Without `t` there is no velocity effect.
|
|
111
|
-
- **Tilt** (`altitude` near 0.3..0.6 radians with an `azimuth`) turns a pencil into broad side
|
|
112
|
-
shading; upright points draw a fine line.
|
|
113
|
-
- **Space points** about a third of the brush size apart or closer; the brush fills in dabs
|
|
114
|
-
between them. Long smooth curves need more points than straight lines.
|
|
115
|
-
- **Use `rotation: "stroke"`** for flat tips (pastel, charcoal, chisel marker) so the mark turns
|
|
116
|
-
with the path; `fixed` for calligraphic nibs.
|
|
104
|
+
- **Big to small, dark to light (or light to dark), one decision per layer.** Name layers by purpose ("Underpainting", "Shadows", "Line"). Lower a layer's `opacity` instead of repainting.
|
|
105
|
+
- **Pressure is your value control** on grainy media: points with `pressure` 0.2..0.4 give texture-catching, broken marks; 0.8..1 fills the grain. Vary pressure along a stroke (swell in the middle, lighten at the ends) for natural marks.
|
|
106
|
+
- **Give points a time `t`** (milliseconds, about 8..16 ms apart for natural speed) when using an ink or brush pen: velocity dynamics thin fast strokes. Without `t` there is no velocity effect.
|
|
107
|
+
- **Tilt** (`altitude` near 0.3..0.6 radians with an `azimuth`) turns a pencil into broad side shading; upright points draw a fine line.
|
|
108
|
+
- **Space points** about a third of the brush size apart or closer; the brush fills in dabs between them. Long smooth curves need more points than straight lines.
|
|
109
|
+
- **Use `rotation: "stroke"`** for flat tips (pastel, charcoal, chisel marker) so the mark turns with the path; `fixed` for calligraphic nibs.
|
|
117
110
|
- **Blending tools**:
|
|
118
|
-
- `blender`: `strength` 0.3..0.6 for soft transitions, `distance` 0.2..0.5 (fraction of the
|
|
119
|
-
|
|
120
|
-
blends like a soft blur. Work along an edge in short strokes rather than over everything.
|
|
121
|
-
- `smudge`: `length` near 0.9 drags paint far (long streaks), 0.5 short pushes; `strength`
|
|
122
|
-
0.5..0.8. `mixing: "pigment"` (the `wet-smudge` preset) smears colours into each other like
|
|
123
|
-
wet paint.
|
|
111
|
+
- `blender`: `strength` 0.3..0.6 for soft transitions, `distance` 0.2..0.5 (fraction of the tip) for how far colours travel. Keep `mixing: "pigment"` for painterly blends; `rgb` blends like a soft blur. Work along an edge in short strokes rather than over everything.
|
|
112
|
+
- `smudge`: `length` near 0.9 drags paint far (long streaks), 0.5 short pushes; `strength` 0.5..0.8. `mixing: "pigment"` (the `wet-smudge` preset) smears colours into each other like wet paint.
|
|
124
113
|
- Mixer Brush: blend with flow 0.3..0.6; at full flow it paints only its own colour.
|
|
125
|
-
- **Pick-up and mix ratios**: `pickup` 0.3..0.7 with `mix` 0.4..0.7 gives a brush that drags
|
|
126
|
-
the colours it crosses into its own; `dirty: true` keeps them for the next stroke (wipe with
|
|
114
|
+
- **Pick-up and mix ratios**: `pickup` 0.3..0.7 with `mix` 0.4..0.7 gives a brush that drags the colours it crosses into its own; `dirty: true` keeps them for the next stroke (wipe with
|
|
127
115
|
`clean_mixer_brush`). Keep `pickup` 0 for clean, predictable colour.
|
|
128
|
-
- **Multi-colour**: give 2..8 `colors` (or none for the paint and secondary colours). `tip` mode
|
|
129
|
-
with a flat tip and `rotation: "stroke"` paints ribbons; `softness` 0.3..0.7 keeps the stripes
|
|
130
|
-
readable. `dab` mode with `order: "sequence"` and `length` 5..20 walks through a palette;
|
|
116
|
+
- **Multi-colour**: give 2..8 `colors` (or none for the paint and secondary colours). `tip` mode with a flat tip and `rotation: "stroke"` paints ribbons; `softness` 0.3..0.7 keeps the stripes readable. `dab` mode with `order: "sequence"` and `length` 5..20 walks through a palette;
|
|
131
117
|
`random` for foliage and confetti.
|
|
132
|
-
- **Pigment for paint, multiply for markers**: tip `blend: "pigment"` mixes subtractively on the
|
|
133
|
-
canvas; `multiply` darkens where marker strokes overlap. Pigment layers are written as Normal
|
|
134
|
-
to PSD (the export warns).
|
|
118
|
+
- **Pigment for paint, multiply for markers**: tip `blend: "pigment"` mixes subtractively on the canvas; `multiply` darkens where marker strokes overlap. Pigment layers are written as Normal to PSD (the export warns).
|
|
135
119
|
- **Painterly layer modes do the glazing for you** (`update_layer` `blend`, or a brush tip):
|
|
136
|
-
- `watercolor`: the layer is a transparent wash. Washes multiply wavelength by wavelength, so
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
- `
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
- `shadow`: shades as if light were blocked, coloured by the layer (paint shadows in a cool
|
|
144
|
-
blue-violet), never crushing to black. White does nothing.
|
|
145
|
-
|
|
146
|
-
PSD has none of them: `export_psd` writes the nearest standard mode (watercolor and shadow
|
|
147
|
-
as Multiply, tint as Color, highlight as Screen) and warns; the merged image stays exact.
|
|
148
|
-
- **Grow the canvas instead of starting big** with `extend_canvas` (pixels per side; nothing
|
|
149
|
-
painted moves relative to anything else). Adding `left` or `top` shifts every coordinate you
|
|
150
|
-
hold by (+left, +top): re-read `list_layers` or use the returned `rect`. Dry wet paint first.
|
|
120
|
+
- `watercolor`: the layer is a transparent wash. Washes multiply wavelength by wavelength, so each glaze darkens and blue over yellow makes green. White is clear: paint glazes on a layer over the underpainting, at opacity 0.4..0.8.
|
|
121
|
+
- `tint`: recolours what is below (its hue and chroma) and keeps its lightness, gently near white and black. Use it to warm or cool a whole passage.
|
|
122
|
+
- `highlight`: adds coloured light that rolls off towards white instead of clipping. Use it for glints and glow; black does nothing.
|
|
123
|
+
- `shadow`: shades as if light were blocked, coloured by the layer (paint shadows in a cool blue-violet), never crushing to black. White does nothing.
|
|
124
|
+
|
|
125
|
+
PSD has none of them: `export_psd` writes the nearest standard mode (watercolor and shadow as Multiply, tint as Color, highlight as Screen) and warns; the merged image stays exact.
|
|
126
|
+
- **Grow the canvas instead of starting big** with `extend_canvas` (pixels per side; nothing painted moves relative to anything else). Adding `left` or `top` shifts every coordinate you hold by (+left, +top): re-read `list_layers` or use the returned `rect`. Dry wet paint first.
|
|
151
127
|
`set_canvas` only crops or grows at the bottom-right.
|
|
152
|
-
- **Save brushes you build** in the brush library: `create_brush` with `basedOn` and the facets
|
|
153
|
-
|
|
154
|
-
`export_brushes` / `import_brushes`. A saved brush shows in every editor that shares the
|
|
155
|
-
library; `set_brush` its id to paint with it.
|
|
128
|
+
- **Save brushes you build** in the brush library: `create_brush` with `basedOn` and the facets you changed (or `get_brush` then `create_brush` with its `brush`), and share them with
|
|
129
|
+
`export_brushes` / `import_brushes`. A saved brush shows in every editor that shares the library; `set_brush` its id to paint with it.
|
|
156
130
|
|
|
157
131
|
Which facet sets which engine setting: [references/brush-facets.md](references/brush-facets.md).
|
|
158
132
|
|
|
@@ -272,6 +246,17 @@ is a canvas coordinate: read [references/canvas-hosted.md](references/canvas-hos
|
|
|
272
246
|
| `get_paper` | Read every setting of the current paper (pattern, seed, scale, tiling, depth, shading, dry and wet tuning, and `metallic`, `backlight`, `backlightColor` when set). |
|
|
273
247
|
| `set_paper` | Change the paper: `preset`, then any of `color`, `depth` (0..1), `scale` (0.25..8), `seed` (another sheet), `pattern`, `tiling`, `shading`, `dry` / `wet` tuning (`contrast` 0..3, `invert`), `metallic`, `backlight` (0..1, light from behind: glazes glow, opaque paint blocks; preset `stained-glass`) and `backlightColor`. Affects new strokes' grain and how the paper shows; strokes already painted keep their pixels. Returns the paper. |
|
|
274
248
|
|
|
249
|
+
### Suggesting paint
|
|
250
|
+
|
|
251
|
+
Contributing while the user paints: suggest, don't paint. Read [references/painting-alongside.md](references/painting-alongside.md).
|
|
252
|
+
|
|
253
|
+
| Tool | Use |
|
|
254
|
+
| --- | --- |
|
|
255
|
+
| `propose_paint` | Suggest paint as a ghost the user accepts or dismisses: `title`, `rationale`, `ops` (`stroke` with points and a dry brush, `wash` over its layer, `echo` of stroke ids moved / turned / scaled / repeated) and where its new layer goes (`place` top, bottom or above `layerId`). Returns the proposal id, the ghost's `bounds` and the strokes it echoes. Use it for contributions the user didn't ask for. |
|
|
256
|
+
| `list_paint_proposals` | Read the pending paint proposals: id, title, rationale, who proposed it, op kinds, placement, bounds, the strokes it echoes and any since removed (`missing`), and whether accepting is allowed. Call before accepting or rejecting. |
|
|
257
|
+
| `accept_paint_proposal` | Paint a pending proposal on a new layer as one undo step recorded as the proposer's (`proposalId`). Only when the user said yes. Returns the layer id, stroke ids and undo step name. Refuses when a stroke it echoes is gone. |
|
|
258
|
+
| `reject_paint_proposal` | Dismiss a pending proposal (`proposalId`); nothing changes. Use it to withdraw a suggestion that no longer fits. Returns the id and title. |
|
|
259
|
+
|
|
275
260
|
### Layers
|
|
276
261
|
|
|
277
262
|
| Tool | Use |
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# Painting alongside the user
|
|
2
|
+
|
|
3
|
+
When the user is painting and you contribute on your own initiative, **suggest, don't paint**:
|
|
4
|
+
`propose_paint` shows your idea as a ghost over the canvas, and the user accepts or dismisses it.
|
|
5
|
+
Accepted, it lands on a new layer of its own as one undo step recorded as yours, and the user's
|
|
6
|
+
active layer stays theirs. Paint directly only when asked to.
|
|
7
|
+
|
|
8
|
+
- **Play to what agents do well**: a `wash` (a warm ground with `place: "bottom"`, a glaze over a
|
|
9
|
+
passage), an `echo` of the user's own strokes (grass along the horizon, rain, hatching, a
|
|
10
|
+
repeated motif: `list_strokes` for the ids, then `dx` / `dy` / `rotate` / `scale` / `repeat`),
|
|
11
|
+
or a few deliberate `stroke`s. Not a stroke-by-stroke rendering of a subject.
|
|
12
|
+
- **Small and complementary.** One idea per proposal, with a `title` that says what it adds and a
|
|
13
|
+
`rationale` that says why it fits what the user just painted.
|
|
14
|
+
- **Dry brushes only** (dab, particle, bristle or mixer without pickup). Suggestions are previewed
|
|
15
|
+
and painted on their own layer, which wet paint, thick paint and pickup can't do.
|
|
16
|
+
- **Withdraw what no longer fits** with `reject_paint_proposal`; an echo whose strokes the user
|
|
17
|
+
removed can't be accepted (`missing` in `list_paint_proposals`).
|
|
18
|
+
|
|
19
|
+
The tools are `propose_paint`, `list_paint_proposals`, `accept_paint_proposal` and `reject_paint_proposal` (see SKILL.md, Suggesting paint).
|