@pixerate/editor 0.240.0 → 0.241.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.
Files changed (37) hide show
  1. package/dist/animation-editor/index.cjs +58 -58
  2. package/dist/animation-editor/index.js +3 -3
  3. package/dist/{brushstrokeRender-WB67GMUP.js → brushstrokeRender-MOYGEXOC.js} +2 -2
  4. package/dist/{brushstrokeRender-MPOM7BFW.cjs → brushstrokeRender-UKADOV5D.cjs} +5 -5
  5. package/dist/canvas/index.cjs +8 -8
  6. package/dist/canvas/index.js +1 -1
  7. package/dist/{chunk-NKTNLJUJ.cjs → chunk-5BR7LC24.cjs} +99 -11
  8. package/dist/{chunk-ZXNO3ZOX.cjs → chunk-7F4G74UQ.cjs} +35 -35
  9. package/dist/{chunk-AD7GA3TL.cjs → chunk-AFLMXITL.cjs} +23 -23
  10. package/dist/{chunk-PP6BXVRL.cjs → chunk-HGGJ36HR.cjs} +1 -1
  11. package/dist/{chunk-BBUE3UJL.cjs → chunk-HW72ABGR.cjs} +86 -86
  12. package/dist/{chunk-7YGBSFC6.js → chunk-ILM6GYAX.js} +1 -1
  13. package/dist/{chunk-THXFU3JB.cjs → chunk-KCMV2534.cjs} +2 -2
  14. package/dist/{chunk-3E36VDMJ.js → chunk-NE6OOKWJ.js} +1 -1
  15. package/dist/{chunk-RV5DKZHU.js → chunk-QP2B3MID.js} +1 -1
  16. package/dist/{chunk-UUBO6RB5.js → chunk-UDBDYZET.js} +1 -1
  17. package/dist/{chunk-PJYG6FCF.js → chunk-XBZK47LV.js} +98 -10
  18. package/dist/{chunk-XK4SST43.js → chunk-ZDPLZDTT.js} +1 -1
  19. package/dist/image-editor/index.cjs +775 -775
  20. package/dist/image-editor/index.js +4 -4
  21. package/dist/paint-editor/controller.d.cts +67 -0
  22. package/dist/paint-editor/controller.d.ts +67 -0
  23. package/dist/paint-editor/effect-paint.d.cts +60 -3
  24. package/dist/paint-editor/effect-paint.d.ts +60 -3
  25. package/dist/paint-editor/index.cjs +676 -430
  26. package/dist/paint-editor/index.js +282 -36
  27. package/dist/paint-editor/stickers.d.cts +6 -0
  28. package/dist/paint-editor/stickers.d.ts +6 -0
  29. package/dist/paint-editor/thick.d.cts +4 -0
  30. package/dist/paint-editor/thick.d.ts +4 -0
  31. package/dist/paint-editor/wet.d.cts +8 -0
  32. package/dist/paint-editor/wet.d.ts +8 -0
  33. package/dist/vector/index.cjs +962 -962
  34. package/dist/vector/index.js +4 -4
  35. package/package.json +1 -1
  36. package/skills/pixerate-paint-editor/SKILL.md +17 -21
  37. package/skills/pixerate-paint-editor/references/effect-paint.md +25 -0
@@ -26,7 +26,7 @@ import {
26
26
  traceField,
27
27
  traceVectorImage,
28
28
  vectorTraceContours
29
- } from "../chunk-UUBO6RB5.js";
29
+ } from "../chunk-UDBDYZET.js";
30
30
  import {
31
31
  applyHomography,
32
32
  homographyFromPoints,
@@ -53,7 +53,7 @@ import {
53
53
  reverseMorphContour,
54
54
  subpathToMorphContour,
55
55
  turnMorphContour
56
- } from "../chunk-XK4SST43.js";
56
+ } from "../chunk-ZDPLZDTT.js";
57
57
  import {
58
58
  DEFAULT_VECTOR_FONT,
59
59
  IDENTITY_MATRIX,
@@ -526,8 +526,8 @@ import {
526
526
  withVectorStrokes,
527
527
  withVectorTargetPaint,
528
528
  zigzagPaths
529
- } from "../chunk-7YGBSFC6.js";
530
- import "../chunk-PJYG6FCF.js";
529
+ } from "../chunk-ILM6GYAX.js";
530
+ import "../chunk-XBZK47LV.js";
531
531
  import {
532
532
  createProvenance
533
533
  } from "../chunk-M6DNZNVY.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pixerate/editor",
3
- "version": "0.240.0",
3
+ "version": "0.241.0",
4
4
  "description": "UI-agnostic rich text and media editing core library",
5
5
  "author": "Pixerate",
6
6
  "license": "MIT",
@@ -235,21 +235,19 @@ for the controls and presets.
235
235
 
236
236
  ## Effect paint
237
237
 
238
- `set_effect_paint` makes a generator, overlay or title effect the paint. It is rendered once at
239
- the canvas size, and every stroke then takes each pixel's colour from that picture, fixed to the
240
- canvas: painting reveals a hidden image where the brush goes. Its transparency paints nothing, so
241
- an overlay paints only where it has pixels.
238
+ `set_effect_paint` makes a generator, overlay or title effect the paint: rendered once, every
239
+ stroke takes each pixel's colour from it, fixed to the canvas (painting reveals a hidden image).
240
+ Its transparency paints nothing.
242
241
 
243
242
  1. `search_effects` (`use` generator, overlay or title) and `describe_effect` for the controls.
244
- 2. `set_effect_paint` with `effect`, `values` and `time` (ms, default 0). Wait for it: strokes that
245
- would use it are refused while it renders.
246
- 3. Paint: dab, particle and bristle brushes take the colour per pixel (the most faithful); the
247
- Mixer Brush and dab brushes with `behavior.pickup` take it per dab at its centre. Wet and
248
- impasto brushes take it per pixel too, shifted by any paint they pick up: in watercolour and
249
- gouache the pattern then flows, blooms and granulates with the water; impasto keeps its relief.
243
+ 2. `set_effect_paint` with `effect`, `values`, `time` (ms, default 0). Wait for it to return.
244
+ 3. Paint: dab, particle and bristle brushes take the colour per pixel; the Mixer Brush and pick-up
245
+ dab brushes take it per dab at its centre. Wet and impasto brushes take it per pixel, shifted by
246
+ paint they pick up (in watercolour and gouache it flows with the water; impasto keeps its relief).
250
247
  Sprayed stickers each take the colour at their centre (they stay recolourable).
251
- 4. `set_color` or `set_paint` goes back to colour; `remove_effect` (target and effect `paint`)
252
- does too, and `update_effect` (target and effect `paint`, `values`) renders new values.
248
+ 4. `set_color`, `set_paint` or `remove_effect` (target and effect `paint`) go back to colour;
249
+ `update_effect` (target and effect `paint`, `values`) renders new values.
250
+ 5. Along each stroke (`map`) or playing on stroke layers (`live`): [references/effect-paint.md](references/effect-paint.md).
253
251
 
254
252
  When to use which:
255
253
 
@@ -259,6 +257,7 @@ When to use which:
259
257
  | The effect in a wash that flows, or in thick paint | `set_effect_paint` and a watercolour, gouache, oil or impasto brush |
260
258
  | The effect inside an exact shape, unchanged by water | Paint the shape, dry it, then `fill_layer_with_effect` with `lockTransparency: true` |
261
259
  | The effect over the whole sheet | `set_paper_effect` or `add_effect_layer` |
260
+ | A pattern that follows the stroke, or paint that moves | `map: { by: "stroke" }`, `live: true` on a stroke layer |
262
261
 
263
262
  ## Canvas-hosted layer
264
263
 
@@ -402,7 +401,8 @@ view), so work with the tools you are given.
402
401
  | `set_paper_effect` | Draw a generator over the paper (`values`, `opacity`, `blend` default `multiply`, `time`); `effect: null` removes it. One undo step. Returns the effect paper. |
403
402
  | `add_effect_layer` | Add a layer drawn by a generator, overlay or title effect (`values`, `name`, `aboveId`, `opacity`, `blend`, `time`); it becomes active. Returns the layer and its effect. |
404
403
  | `fill_layer_with_effect` | Composite a generator, overlay or title effect onto a layer (`layerId`, `values`, `opacity`, `lockTransparency`, `time`). One undo step. Returns the layer id and the effect. |
405
- | `set_effect_paint` | Paint with a generator, overlay or title effect (`effect`, `values`, `time` ms default 0): rendered once at the canvas size, strokes take each pixel's colour from it. Call after `describe_effect`, then `paint_stroke` with a dry brush. Editor state, not an undo step. Returns `effectPaint` (`effect`, `provider`, `values`, `time`). |
404
+ | `set_effect_paint` | Paint with a generator, overlay or title effect (`effect`, `values`, `time` ms default 0): rendered once at the canvas size, strokes take each pixel's colour from it; `map` `{ by: "stroke", length, repeat }` lays it along each stroke; `live` keeps it playing on stroke layers. Call after `describe_effect`, then `paint_stroke`. Editor state, not an undo step. Returns `effectPaint`. |
405
+ | `set_effect_playback` | Play or pause live effect paint in the view (`playing`) and cap its frame rate (`fps` 1..60). Editor state. Returns `playing`, `fps`, `time` and `animation` (what plays, or null). Export a moment with `export_image` / `export_psd` `time`. |
406
406
 
407
407
  ### Guides
408
408
 
@@ -495,13 +495,9 @@ The host may add the shared document tools (see `pixerate-agent-tools`). A paint
495
495
  strokes record it, and replays render it again first, so they need the same provider (an
496
496
  error names the effect and provider when it is missing; `color` on `replay_strokes` repaints
497
497
  in one colour instead).
498
- - **Effect paint in wet paint moves with the water**: the pattern bleeds and blooms like any
499
- pigment, so fine detail softens. For a crisp pattern in an exact shape, paint the shape, dry it,
500
- and `fill_layer_with_effect` with `lockTransparency: true`. Erasers, blenders and smudges ignore
501
- effect paint; a brush with its own gradient, a stroke `color` or `paint`, or `set_color` /
502
- `set_paint` paints colour instead.
503
- - **Effect paint is fixed to the canvas, not the stroke**: a replayed or moved stroke shows the
504
- part of the effect under its new place. Wait for `set_effect_paint` to return before painting;
505
- strokes are refused while it renders.
498
+ - **Effect paint is fixed to the canvas by default** (`map: { by: "stroke" }` follows the stroke),
499
+ and in wet paint it flows with the water; for a crisp pattern in an exact shape, paint and dry
500
+ the shape, then `fill_layer_with_effect` (`lockTransparency: true`). Erasers, blenders and
501
+ smudges ignore it. Wait for `set_effect_paint` to return; strokes are refused while it renders.
506
502
  - **Recorded strokes are kept in saved documents** (`save_paint_document`, `get_paint_document`),
507
503
  so a painting can be replayed and repainted at a higher resolution.
@@ -0,0 +1,25 @@
1
+ # Effect paint along the stroke, and live effect paint
2
+
3
+ - **Along the stroke** (`set_effect_paint` `map: { by: "stroke", length, repeat }`): the effect is
4
+ rendered as a strip `length` px long (16..4096, default 300) and 256 px across. Each pixel takes
5
+ the colour at its distance along the stroke and its place across the tip, so the pattern follows
6
+ the stroke's turns instead of staying fixed to the canvas. `repeat` starts the strip again
7
+ (default), `mirror` runs it back, `clamp` holds the last colour. Use it for ribbons, ropes,
8
+ flames and textures that should flow with the mark; use the default canvas mapping to reveal one
9
+ hidden picture across many strokes. Every colour-laying brush takes it (watercolour, gouache, oil
10
+ and impasto too; sprayed stickers at their centre); particle and bristle marks take the place of
11
+ their pen dab.
12
+ Scaled replays (`export_high_res`) scale `length` with the canvas.
13
+ - **Live** (`live: true`): on a stroke layer (`add_layer {type: "strokes"}`) each stroke keeps
14
+ playing the effect, so the paint moves. Paint the strokes, then `set_effect_playback`
15
+ (`playing`, `fps` 1..60, default 30) plays or pauses them in the view. The document keeps the
16
+ frame at the effect's own `time`; `export_image` and `export_psd` take `time` (ms) to export
17
+ another moment. Live strokes stay editable like any stroke on a stroke layer
18
+ (`update_stroke` with `paint` changes the effect).
19
+ - **Where it applies**: live only plays on stroke layers; on a pixel layer the stroke bakes the
20
+ frame at `time`. A painting plays at most 8 distinct live effects (each needs a renderer per
21
+ frame); paint more strokes with one of them, or bake new ones (`live: false`).
22
+ - **Cost**: each frame redraws the live strokes (and any stroke overlapping them), and renders
23
+ each live effect once. On a large canvas with many live strokes, lower `fps`.
24
+ - **Without the provider** (a document opened elsewhere): the saved pixels show the frame as
25
+ painted, and nothing plays until the provider is registered.