@pixerate/editor 0.219.1 → 0.220.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/{chunk-3X244IZ5.js → chunk-A7GJ6BXI.js} +43 -26
- package/dist/{chunk-SRMDF2VN.cjs → chunk-JBBJE76O.cjs} +43 -26
- package/dist/{chunk-S55JFWDA.cjs → chunk-R35YOUP2.cjs} +407 -161
- package/dist/{chunk-F7Z2MKY2.js → chunk-S6KKLFZO.js} +261 -15
- package/dist/image-editor/controller.d.cts +25 -1
- package/dist/image-editor/controller.d.ts +25 -1
- package/dist/image-editor/index.cjs +1257 -1125
- package/dist/image-editor/index.d.cts +1 -0
- package/dist/image-editor/index.d.ts +1 -0
- package/dist/image-editor/index.js +148 -16
- package/dist/image-editor/layers/hybrid-mask.d.cts +31 -0
- package/dist/image-editor/layers/hybrid-mask.d.ts +31 -0
- package/dist/image-editor/layers/model.d.cts +17 -0
- package/dist/image-editor/layers/model.d.ts +17 -0
- package/dist/image-editor/layers/serialize.d.cts +2 -0
- package/dist/image-editor/layers/serialize.d.ts +2 -0
- package/dist/image-editor/layers/vector-mask.d.cts +10 -5
- package/dist/image-editor/layers/vector-mask.d.ts +10 -5
- package/dist/image-editor/path-edit.d.cts +4 -0
- package/dist/image-editor/path-edit.d.ts +4 -0
- package/dist/image-editor/selection-worker.cjs +3 -3
- package/dist/image-editor/selection-worker.js +1 -1
- package/dist/paint-editor/index.cjs +6 -6
- package/dist/paint-editor/index.js +1 -1
- package/package.json +1 -1
- package/skills/pixerate-image-editor/SKILL.md +2 -1
- package/skills/pixerate-image-editor/references/paths.md +6 -0
- package/skills/pixerate-image-selection-masking/SKILL.md +4 -4
|
@@ -7,7 +7,7 @@ var _chunkZ64NRDEHcjs = require('../chunk-Z64NRDEH.cjs');
|
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
var
|
|
10
|
+
var _chunkR35YOUP2cjs = require('../chunk-R35YOUP2.cjs');
|
|
11
11
|
require('../chunk-A2IS7EHE.cjs');
|
|
12
12
|
require('../chunk-SS53NNZO.cjs');
|
|
13
13
|
|
|
@@ -1659,11 +1659,11 @@ function header(state, options) {
|
|
|
1659
1659
|
return out;
|
|
1660
1660
|
}
|
|
1661
1661
|
function serializePaintDocument(state, options = {}) {
|
|
1662
|
-
const { layers, assets } =
|
|
1662
|
+
const { layers, assets } = _chunkR35YOUP2cjs.serializeLayers.call(void 0, state.layers);
|
|
1663
1663
|
return { ...header(state, options), layers, assets };
|
|
1664
1664
|
}
|
|
1665
1665
|
async function serializePaintDocumentExternal(state, store, options = {}) {
|
|
1666
|
-
const { layers, assets } = await
|
|
1666
|
+
const { layers, assets } = await _chunkR35YOUP2cjs.serializeLayersExternal.call(void 0, state.layers, store);
|
|
1667
1667
|
return { ...header(state, options), layers, assets };
|
|
1668
1668
|
}
|
|
1669
1669
|
function paintLayersOnly(layers, problems) {
|
|
@@ -1700,7 +1700,7 @@ function deserializePaintDocument(raw) {
|
|
|
1700
1700
|
const canvas = normalizeCanvas({ width: r.width, height: r.height, dpi: _nullishCoalesce(r.dpi, () => ( void 0)) });
|
|
1701
1701
|
const paper = _chunkROVK6AXXcjs.normalizePaper.call(void 0, _nullishCoalesce(r.paper, () => ( {})));
|
|
1702
1702
|
const assets = r.assets && typeof r.assets === "object" ? r.assets : {};
|
|
1703
|
-
const layers = paintLayersOnly(
|
|
1703
|
+
const layers = paintLayersOnly(_chunkR35YOUP2cjs.deserializeLayers.call(void 0, r.layers, { assets, problems }), problems);
|
|
1704
1704
|
const wanted = typeof r.activeLayerId === "string" ? r.activeLayerId : null;
|
|
1705
1705
|
const activeLayerId = wanted && _chunkB46UQUDCcjs.findLayer.call(void 0, layers, wanted) ? wanted : _nullishCoalesce(_optionalChain([_chunkB46UQUDCcjs.flattenLayers.call(void 0, layers), 'access', _70 => _70.filter, 'call', _71 => _71((l) => l.type === "pixel"), 'access', _72 => _72.pop, 'call', _73 => _73(), 'optionalAccess', _74 => _74.id]), () => ( null));
|
|
1706
1706
|
const wetEvents = Array.isArray(r.wetEvents) ? r.wetEvents.filter((e) => e && typeof e === "object" && Number.isInteger(e.clock) && typeof e.kind === "string") : [];
|
|
@@ -1716,7 +1716,7 @@ async function deserializePaintDocumentAsync(raw, store) {
|
|
|
1716
1716
|
if (!raw || typeof raw !== "object") throw new Error("Not a paint document: expected a JSON object.");
|
|
1717
1717
|
const r = raw;
|
|
1718
1718
|
const problems = [];
|
|
1719
|
-
const assets = await
|
|
1719
|
+
const assets = await _chunkR35YOUP2cjs.resolveExternalAssets.call(void 0, _nullishCoalesce(r.assets, () => ( {})), store, problems);
|
|
1720
1720
|
const loaded = deserializePaintDocument({ ...r, assets });
|
|
1721
1721
|
return { ...loaded, problems: [...problems, ...loaded.problems] };
|
|
1722
1722
|
}
|
|
@@ -5468,7 +5468,7 @@ var PaintEditorController = (_class10 = class _PaintEditorController {
|
|
|
5468
5468
|
return next.type === "group" ? { ...next, children: toStandard(next.children) } : next;
|
|
5469
5469
|
});
|
|
5470
5470
|
const layers = toStandard(dried);
|
|
5471
|
-
const result =
|
|
5471
|
+
const result = _chunkR35YOUP2cjs.exportPsd.call(void 0, { width, height, layers: [paperLayer, ...layers], merged, resolution: dpi });
|
|
5472
5472
|
for (const [mode, names] of changed) {
|
|
5473
5473
|
const label = _nullishCoalesce(_optionalChain([_chunkOLNIPTB3cjs.BLEND_MODES, 'access', _279 => _279.find, 'call', _280 => _280((m) => m.id === mode), 'optionalAccess', _281 => _281.label]), () => ( mode));
|
|
5474
5474
|
const std = _nullishCoalesce(_optionalChain([_chunkOLNIPTB3cjs.BLEND_MODES, 'access', _282 => _282.find, 'call', _283 => _283((m) => m.id === _chunkOLNIPTB3cjs.standardBlendMode.call(void 0, mode)), 'optionalAccess', _284 => _284.label]), () => ( _chunkOLNIPTB3cjs.standardBlendMode.call(void 0, mode)));
|
package/package.json
CHANGED
|
@@ -310,10 +310,11 @@ in the source frame at the document's bit depth, colour mode and profile. Read
|
|
|
310
310
|
| `add_shape_component` | Add a live shape or path to a shape layer with `op` (`combine`, `subtract`, `intersect`, `exclude`), on top unless `index`. Use it for cut-outs, rings, badges. Returns the shape. |
|
|
311
311
|
| `remove_shape_component` | Delete one component (not the last: delete the layer instead). Returns the shape. |
|
|
312
312
|
| `merge_shape_components` | Merge Shape Components: the combined area becomes one plain component (live shapes become paths); the look does not change. Returns the shape. |
|
|
313
|
-
| `get_vector_mask` | Read-only. A layer's vector mask: enabled, linked, inverted, fill rule, density, feather, bounds
|
|
313
|
+
| `get_vector_mask` | Read-only. A layer's vector mask: enabled, linked, inverted, fill rule, density, feather, bounds, components (subpaths in document px), `edges` (hybrid soft segments) and `segmentCount`, or null. Read it before editing the path. |
|
|
314
314
|
| `add_vector_mask` | Layer › Vector Mask on any layer but a shape: `from` `path` (a `shape`, `subpaths` or `components`, like `add_shape_layer`, or a document path's `pathId`), `selection` (traced, `tolerance` px), `reveal-all` or `hide-all` (empty path). Reveals inside the path, sharp at any size; it combines with the raster mask. Returns the vector mask. |
|
|
315
315
|
| `set_vector_mask_path` | Replace the vector mask's path (properties kept). Returns the vector mask. |
|
|
316
316
|
| `set_vector_mask_properties` | `enabled`, `linked` (false: stays put when the layer moves), `inverted`, `density`, `feather` px; the path is kept. Returns the vector mask. |
|
|
317
|
+
| `set_vector_mask_edge` | Hybrid mask: one segment's edge (`component`, `subpath`, `segment`): `hard` (default), `feather` (`radius` px) or `matte` (a corridor `inner` px in to `outer` px out, solved from the layer's colours, for hair and fur). Modes blend where they meet. Check with `inspect_mask_edge` `target: "vector-mask"`. Returns the vector mask. |
|
|
317
318
|
| `rasterize_vector_mask` | Multiply the path into the raster mask (adding one) and drop the vector mask, so it can be painted. Returns the mask summary. |
|
|
318
319
|
| `remove_vector_mask` | Delete the vector mask (the raster mask stays). |
|
|
319
320
|
| `selection_to_path` | Read-only. Make Work Path: the selection's outline as closed Bézier subpaths (`tolerance` px, `cornerRoundness`, `minArea`); returns `svg` and `fillRule: "evenodd"` to pass to `add_vector_mask`, `set_vector_mask_path` or `add_shape_layer`. |
|
|
@@ -10,3 +10,9 @@ panel). The Work Path is the scratch path; saved paths stay until deleted.
|
|
|
10
10
|
handles → `set_path_geometry` (one undo step); shapes `set_shape_component`, vector masks
|
|
11
11
|
`set_vector_mask_path`.
|
|
12
12
|
4. **Read first**: `list_paths` for ids, names and bounds; `get_path` for the `components` to edit.
|
|
13
|
+
5. **Hybrid vector masks**: a vector mask's segments can each have their own edge.
|
|
14
|
+
`set_vector_mask_edge` makes a segment `feather` (a soft falloff of `radius` px) or `matte` (a
|
|
15
|
+
corridor `inner` px inside to `outer` px outside, solved from the layer's colours, for hair and
|
|
16
|
+
fur); the rest stay `hard`. In the editor, Alt+Shift-click a vector mask segment with Direct
|
|
17
|
+
Selection to cycle hard → feather → matte. Edges are addressed by segment index, so after adding
|
|
18
|
+
or deleting anchors on that subpath, check `get_vector_mask` `edges` and set them again.
|
|
@@ -104,7 +104,7 @@ This skill is the method. `pixerate-image-editor` has the full tool reference.
|
|
|
104
104
|
| --- | --- |
|
|
105
105
|
| Geometric areas: a frame, a screen, a band | `select_rect` / `select_ellipse`, with `feather` for soft transitions |
|
|
106
106
|
| One object among others, where you can box it (a product on a table, a person in a group) | `select_object` with a `rect` a little larger than the object on every side; then `quick_select` add / subtract strokes for what it missed |
|
|
107
|
-
| A subject with a clear outline (product, person, animal) | `select_subject` (with a host model, by description; without one it takes whatever stands out most, so check `method` and the result); else `select_object` around it, or `select_polygon` with `snapToEdges` (12–30 points within `width` of the edge), then `refine_selection` |
|
|
107
|
+
| A subject with a clear outline (product, person, animal) | `select_subject` (with a host model, by description; without one it takes whatever stands out most, so check `method` and the result); else `select_object` around it, or `select_polygon` with `snapToEdges` (12–30 points within `width` of the edge), then `refine_selection`; hard sides and loose hair in one mask: `add_vector_mask` `from: "selection"`, then `set_vector_mask_edge` `matte` on the hair segments |
|
|
108
108
|
| An area or subject that differs from its surroundings (a shirt, a sky, a car) | `quick_select` with strokes painted inside it, away from the edge (`size` a fraction of its width); `add` / `subtract` strokes where it fell short or leaked |
|
|
109
109
|
| The sky (to replace, recolour, or to leave out with `invert_selection`) | `select_sky`; raise `threshold` for haze or a sunset glow, lower it if pale buildings come in |
|
|
110
110
|
| A sharp subject on a blurred background (shallow depth of field) | `select_focus_area`; raise `range` if parts of the subject are missing, `noise` if grainy background comes in |
|
|
@@ -174,9 +174,9 @@ This skill is the method. `pixerate-image-editor` has the full tool reference.
|
|
|
174
174
|
the image's border, which may be a bright sign rather than the person. When `method` is
|
|
175
175
|
`saliency`, check with `capture_view`; if it's wrong, use `select_object` with a box.
|
|
176
176
|
- **Object Selection takes part of the background:** without a model, anything in the box unlike
|
|
177
|
-
the background around it is the object (a shadow,
|
|
178
|
-
|
|
179
|
-
|
|
177
|
+
the background around it is the object (a shadow, mist). Leave background on every side (none
|
|
178
|
+
past the image's edge), then `subtract` a `quick_select` stroke. `point` may stop at an inner
|
|
179
|
+
edge, miss background-coloured parts, or take a patch a small object sits in: box small ones.
|
|
180
180
|
- **Quick Selection spills over a weak edge:** a stroke grows into neighbouring areas of a
|
|
181
181
|
similar colour. Paint smaller strokes further from the edge, then a `subtract` stroke on the
|
|
182
182
|
spill. Strokes near an edge also pull in the other side.
|