@pixerate/editor 0.202.0 → 0.203.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/image-editor/controller.d.cts +24 -1
- package/dist/image-editor/controller.d.ts +24 -1
- package/dist/image-editor/index.cjs +226 -171
- package/dist/image-editor/index.js +78 -23
- package/dist/image-editor/selection/segmentation.d.cts +7 -0
- package/dist/image-editor/selection/segmentation.d.ts +7 -0
- package/package.json +1 -1
- package/skills/pixerate-image-editor/SKILL.md +2 -2
|
@@ -163,6 +163,9 @@ export interface FocusAreaCommandOptions extends FocusAreaOptions {
|
|
|
163
163
|
}
|
|
164
164
|
/** Options of {@link ImageEditorController.selectSky}. */
|
|
165
165
|
export interface SkyCommandOptions extends SkyOptions {
|
|
166
|
+
/** With a segmentation provider set, ask it for the sky (default true); false finds it classically. */
|
|
167
|
+
useModel?: boolean;
|
|
168
|
+
signal?: AbortSignal;
|
|
166
169
|
/** How the sky combines with the selection (default `replace`). */
|
|
167
170
|
mode?: SelectionMode;
|
|
168
171
|
/** Sample every layer (default true) or only the active pixel layer. */
|
|
@@ -170,6 +173,12 @@ export interface SkyCommandOptions extends SkyOptions {
|
|
|
170
173
|
}
|
|
171
174
|
/** Options of {@link ImageEditorController.selectObject}. */
|
|
172
175
|
export interface SelectObjectCommandOptions {
|
|
176
|
+
/**
|
|
177
|
+
* With a segmentation provider set, ask it for the object in the box or under the point (default
|
|
178
|
+
* true), falling back to GrabCut when nothing it returns fits; false always uses GrabCut.
|
|
179
|
+
*/
|
|
180
|
+
useModel?: boolean;
|
|
181
|
+
signal?: AbortSignal;
|
|
173
182
|
/** How the object combines with the selection (default `replace`). */
|
|
174
183
|
mode?: SelectionMode;
|
|
175
184
|
/** Sample every layer (default true) or only the active pixel layer. */
|
|
@@ -1549,13 +1558,26 @@ export declare class ImageEditorController {
|
|
|
1549
1558
|
* one undo step. Resolves to the resulting selection.
|
|
1550
1559
|
*/
|
|
1551
1560
|
quickSelect(strokes: ImagePoint[][], options?: QuickSelectCommandOptions): Promise<SelectionMask | null>;
|
|
1561
|
+
/**
|
|
1562
|
+
* Asks the segmentation provider (which must be set) for `request.target` in the flattened image
|
|
1563
|
+
* and returns its results with masks decoded to pixels.
|
|
1564
|
+
*/
|
|
1565
|
+
private modelSegments;
|
|
1566
|
+
/**
|
|
1567
|
+
* The model's object for Object Selection: of what it returns, the pieces mostly inside the box
|
|
1568
|
+
* (clipped to the box grown by a tenth) or those under the point. `null` when none fits.
|
|
1569
|
+
*/
|
|
1570
|
+
private modelObject;
|
|
1552
1571
|
/**
|
|
1553
1572
|
* Object Selection: the object inside `target.rect` (natural pixels; what is outside the box is
|
|
1554
1573
|
* background) or under `target.point`, found by GrabCut (colour models of object and background
|
|
1555
1574
|
* plus a graph cut along edges), combined with the selection by `mode` as one undo step.
|
|
1556
1575
|
* Resolves to the resulting selection.
|
|
1557
1576
|
*/
|
|
1558
|
-
selectObject(target: ObjectTarget, options?: SelectObjectCommandOptions): Promise<
|
|
1577
|
+
selectObject(target: ObjectTarget, options?: SelectObjectCommandOptions): Promise<{
|
|
1578
|
+
selection: SelectionMask | null;
|
|
1579
|
+
method: 'model' | 'grabcut';
|
|
1580
|
+
}>;
|
|
1559
1581
|
/**
|
|
1560
1582
|
* Select › Focus Area: selects the parts of the image that are in focus (fine detail above the
|
|
1561
1583
|
* image's noise), fitted to its edges, combined with the selection by `mode` as one undo step.
|
|
@@ -1573,6 +1595,7 @@ export declare class ImageEditorController {
|
|
|
1573
1595
|
*/
|
|
1574
1596
|
selectSky(options?: SkyCommandOptions): Promise<{
|
|
1575
1597
|
selection: SelectionMask | null;
|
|
1598
|
+
method: 'model' | 'classical';
|
|
1576
1599
|
note?: string;
|
|
1577
1600
|
}>;
|
|
1578
1601
|
/**
|
|
@@ -163,6 +163,9 @@ export interface FocusAreaCommandOptions extends FocusAreaOptions {
|
|
|
163
163
|
}
|
|
164
164
|
/** Options of {@link ImageEditorController.selectSky}. */
|
|
165
165
|
export interface SkyCommandOptions extends SkyOptions {
|
|
166
|
+
/** With a segmentation provider set, ask it for the sky (default true); false finds it classically. */
|
|
167
|
+
useModel?: boolean;
|
|
168
|
+
signal?: AbortSignal;
|
|
166
169
|
/** How the sky combines with the selection (default `replace`). */
|
|
167
170
|
mode?: SelectionMode;
|
|
168
171
|
/** Sample every layer (default true) or only the active pixel layer. */
|
|
@@ -170,6 +173,12 @@ export interface SkyCommandOptions extends SkyOptions {
|
|
|
170
173
|
}
|
|
171
174
|
/** Options of {@link ImageEditorController.selectObject}. */
|
|
172
175
|
export interface SelectObjectCommandOptions {
|
|
176
|
+
/**
|
|
177
|
+
* With a segmentation provider set, ask it for the object in the box or under the point (default
|
|
178
|
+
* true), falling back to GrabCut when nothing it returns fits; false always uses GrabCut.
|
|
179
|
+
*/
|
|
180
|
+
useModel?: boolean;
|
|
181
|
+
signal?: AbortSignal;
|
|
173
182
|
/** How the object combines with the selection (default `replace`). */
|
|
174
183
|
mode?: SelectionMode;
|
|
175
184
|
/** Sample every layer (default true) or only the active pixel layer. */
|
|
@@ -1549,13 +1558,26 @@ export declare class ImageEditorController {
|
|
|
1549
1558
|
* one undo step. Resolves to the resulting selection.
|
|
1550
1559
|
*/
|
|
1551
1560
|
quickSelect(strokes: ImagePoint[][], options?: QuickSelectCommandOptions): Promise<SelectionMask | null>;
|
|
1561
|
+
/**
|
|
1562
|
+
* Asks the segmentation provider (which must be set) for `request.target` in the flattened image
|
|
1563
|
+
* and returns its results with masks decoded to pixels.
|
|
1564
|
+
*/
|
|
1565
|
+
private modelSegments;
|
|
1566
|
+
/**
|
|
1567
|
+
* The model's object for Object Selection: of what it returns, the pieces mostly inside the box
|
|
1568
|
+
* (clipped to the box grown by a tenth) or those under the point. `null` when none fits.
|
|
1569
|
+
*/
|
|
1570
|
+
private modelObject;
|
|
1552
1571
|
/**
|
|
1553
1572
|
* Object Selection: the object inside `target.rect` (natural pixels; what is outside the box is
|
|
1554
1573
|
* background) or under `target.point`, found by GrabCut (colour models of object and background
|
|
1555
1574
|
* plus a graph cut along edges), combined with the selection by `mode` as one undo step.
|
|
1556
1575
|
* Resolves to the resulting selection.
|
|
1557
1576
|
*/
|
|
1558
|
-
selectObject(target: ObjectTarget, options?: SelectObjectCommandOptions): Promise<
|
|
1577
|
+
selectObject(target: ObjectTarget, options?: SelectObjectCommandOptions): Promise<{
|
|
1578
|
+
selection: SelectionMask | null;
|
|
1579
|
+
method: 'model' | 'grabcut';
|
|
1580
|
+
}>;
|
|
1559
1581
|
/**
|
|
1560
1582
|
* Select › Focus Area: selects the parts of the image that are in focus (fine detail above the
|
|
1561
1583
|
* image's noise), fitted to its edges, combined with the selection by `mode` as one undo step.
|
|
@@ -1573,6 +1595,7 @@ export declare class ImageEditorController {
|
|
|
1573
1595
|
*/
|
|
1574
1596
|
selectSky(options?: SkyCommandOptions): Promise<{
|
|
1575
1597
|
selection: SelectionMask | null;
|
|
1598
|
+
method: 'model' | 'classical';
|
|
1576
1599
|
note?: string;
|
|
1577
1600
|
}>;
|
|
1578
1601
|
/**
|