@pixerate/editor 0.198.0 → 0.200.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.
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Select › Focus Area: the parts of the image that are in focus. Fine detail survives only where
3
+ * the lens was focused, so a sharpness map (the Laplacian's local energy, less a floor for the
4
+ * image's noise) is split into in and out of focus, closed over smooth areas inside sharp ones,
5
+ * and fitted to the image's edges with a guided filter.
6
+ */
7
+ import type { PixelBuffer, SelectionMask } from '../mask.cjs';
8
+ export interface FocusAreaOptions {
9
+ /** In-Focus Range 0..100 (default 50): higher takes in less sharp areas too. */
10
+ range?: number;
11
+ /** Image Noise Level 0..100 (default 0): raise it when grain is selected as detail. */
12
+ noise?: number;
13
+ /** Soften the edge over this many natural pixels (default 4; 0 for a hard edge). */
14
+ softness?: number;
15
+ }
16
+ export interface FocusAreaResult {
17
+ selection: SelectionMask;
18
+ /** The noise measured in the image (σ of luminance, in levels of 255). */
19
+ noiseLevel: number;
20
+ }
21
+ /** The in-focus areas of `pixels` as a selection of the whole image. */
22
+ export declare function focusArea(pixels: PixelBuffer, options?: FocusAreaOptions): FocusAreaResult;
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Select › Focus Area: the parts of the image that are in focus. Fine detail survives only where
3
+ * the lens was focused, so a sharpness map (the Laplacian's local energy, less a floor for the
4
+ * image's noise) is split into in and out of focus, closed over smooth areas inside sharp ones,
5
+ * and fitted to the image's edges with a guided filter.
6
+ */
7
+ import type { PixelBuffer, SelectionMask } from '../mask.js';
8
+ export interface FocusAreaOptions {
9
+ /** In-Focus Range 0..100 (default 50): higher takes in less sharp areas too. */
10
+ range?: number;
11
+ /** Image Noise Level 0..100 (default 0): raise it when grain is selected as detail. */
12
+ noise?: number;
13
+ /** Soften the edge over this many natural pixels (default 4; 0 for a hard edge). */
14
+ softness?: number;
15
+ }
16
+ export interface FocusAreaResult {
17
+ selection: SelectionMask;
18
+ /** The noise measured in the image (σ of luminance, in levels of 255). */
19
+ noiseLevel: number;
20
+ }
21
+ /** The in-focus areas of `pixels` as a selection of the whole image. */
22
+ export declare function focusArea(pixels: PixelBuffer, options?: FocusAreaOptions): FocusAreaResult;
@@ -7,6 +7,7 @@
7
7
  */
8
8
  import type { CropBox, ImagePoint } from '../../types.cjs';
9
9
  import { type PixelBuffer, type SelectionMask } from '../mask.cjs';
10
+ import { type Rect, type WorkImage } from './work.cjs';
10
11
  /** A mixture of {@link K} full-covariance Gaussians over RGB. */
11
12
  export declare class ColorGmm {
12
13
  private readonly logWeight;
@@ -24,6 +25,23 @@ export declare class ColorGmm {
24
25
  /** The component most likely to have produced the colour. */
25
26
  nearest(r: number, g: number, b: number): number;
26
27
  }
28
+ /** Pixels fixed to one side, and a starting guess, over a window of the work image. */
29
+ export interface GrabCutSetup {
30
+ roi: Rect;
31
+ /** Per window pixel: 1 = starts inside the object. */
32
+ initial: Uint8Array;
33
+ /** Per window pixel: 1 = fixed outside. */
34
+ hardBg: Uint8Array;
35
+ /** Per window pixel: 1 = fixed inside. */
36
+ hardFg: Uint8Array | null;
37
+ }
38
+ /** GrabCut over the setup's window; returns 1 for the object per window pixel. */
39
+ export declare function grabCutLabels(work: WorkImage, setup: GrabCutSetup, iterations: number): Uint8Array;
40
+ /**
41
+ * Keeps the object's main parts: the pieces (4-connected) holding `seed` (window index), or
42
+ * without one, every piece at least a fifth the size of the largest.
43
+ */
44
+ export declare function keepMainPieces(label: Uint8Array, rw: number, rh: number, seed: number | null): void;
27
45
  export interface ObjectSelectionOptions {
28
46
  /** Smoother, less blocky edges (Auto-Enhance). Default false. */
29
47
  enhanceEdge?: boolean;
@@ -7,6 +7,7 @@
7
7
  */
8
8
  import type { CropBox, ImagePoint } from '../../types.js';
9
9
  import { type PixelBuffer, type SelectionMask } from '../mask.js';
10
+ import { type Rect, type WorkImage } from './work.js';
10
11
  /** A mixture of {@link K} full-covariance Gaussians over RGB. */
11
12
  export declare class ColorGmm {
12
13
  private readonly logWeight;
@@ -24,6 +25,23 @@ export declare class ColorGmm {
24
25
  /** The component most likely to have produced the colour. */
25
26
  nearest(r: number, g: number, b: number): number;
26
27
  }
28
+ /** Pixels fixed to one side, and a starting guess, over a window of the work image. */
29
+ export interface GrabCutSetup {
30
+ roi: Rect;
31
+ /** Per window pixel: 1 = starts inside the object. */
32
+ initial: Uint8Array;
33
+ /** Per window pixel: 1 = fixed outside. */
34
+ hardBg: Uint8Array;
35
+ /** Per window pixel: 1 = fixed inside. */
36
+ hardFg: Uint8Array | null;
37
+ }
38
+ /** GrabCut over the setup's window; returns 1 for the object per window pixel. */
39
+ export declare function grabCutLabels(work: WorkImage, setup: GrabCutSetup, iterations: number): Uint8Array;
40
+ /**
41
+ * Keeps the object's main parts: the pieces (4-connected) holding `seed` (window index), or
42
+ * without one, every piece at least a fifth the size of the largest.
43
+ */
44
+ export declare function keepMainPieces(label: Uint8Array, rw: number, rh: number, seed: number | null): void;
27
45
  export interface ObjectSelectionOptions {
28
46
  /** Smoother, less blocky edges (Auto-Enhance). Default false. */
29
47
  enhanceEdge?: boolean;
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Helpers for the masks Focus Area and Select Sky compute on the reduced copy: its luminance and
3
+ * colour planes (the guide for `guidedFilterColor`, which fits a rough mask to the image's edges)
4
+ * and scaling a soft mask back up to the image.
5
+ */
6
+ import { type SelectionMask } from '../mask.cjs';
7
+ import type { WorkImage } from './work.cjs';
8
+ /** The work image as three planes of 0..1 values, the guide `guidedFilterColor` takes. */
9
+ export declare function workPlanes(work: WorkImage): [Float32Array, Float32Array, Float32Array];
10
+ /** The work image's luminance, 0..1. */
11
+ export declare function workLuma(work: WorkImage): Float32Array;
12
+ /** A soft mask over the whole work image (0..1), scaled up bilinearly to a selection of the image. */
13
+ export declare function softMaskToSelection(work: WorkImage, mask: Float32Array): SelectionMask;
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Helpers for the masks Focus Area and Select Sky compute on the reduced copy: its luminance and
3
+ * colour planes (the guide for `guidedFilterColor`, which fits a rough mask to the image's edges)
4
+ * and scaling a soft mask back up to the image.
5
+ */
6
+ import { type SelectionMask } from '../mask.js';
7
+ import type { WorkImage } from './work.js';
8
+ /** The work image as three planes of 0..1 values, the guide `guidedFilterColor` takes. */
9
+ export declare function workPlanes(work: WorkImage): [Float32Array, Float32Array, Float32Array];
10
+ /** The work image's luminance, 0..1. */
11
+ export declare function workLuma(work: WorkImage): Float32Array;
12
+ /** A soft mask over the whole work image (0..1), scaled up bilinearly to a selection of the image. */
13
+ export declare function softMaskToSelection(work: WorkImage, mask: Float32Array): SelectionMask;
@@ -2,3 +2,6 @@ export * from './maxflow.cjs';
2
2
  export * from './work.cjs';
3
3
  export * from './quick.cjs';
4
4
  export * from './grabcut.cjs';
5
+ export * from './subject.cjs';
6
+ export * from './guided.cjs';
7
+ export * from './focus.cjs';
@@ -2,3 +2,6 @@ export * from './maxflow.js';
2
2
  export * from './work.js';
3
3
  export * from './quick.js';
4
4
  export * from './grabcut.js';
5
+ export * from './subject.js';
6
+ export * from './guided.js';
7
+ export * from './focus.js';
@@ -0,0 +1,44 @@
1
+ /**
2
+ * Select Subject without a segmentation model: the most salient subject, found classically.
3
+ *
4
+ * 1. SLIC superpixels (Achanta et al., 2012) group the reduced image into a few hundred patches of
5
+ * similar colour.
6
+ * 2. Each patch's saliency is how unlike the image's border it is (the border is mostly
7
+ * background), times how much it contrasts with the patches around it (region contrast, Cheng
8
+ * et al., 2015), times a mild preference for the centre.
9
+ * 3. Otsu's threshold splits the patches into a first guess at the subject.
10
+ * 4. GrabCut refines that guess along the image's edges, with the clearly-background border fixed.
11
+ *
12
+ * It cannot tell which object a description names: it selects what stands out.
13
+ */
14
+ import type { PixelBuffer, SelectionMask } from '../mask.cjs';
15
+ import { type WorkImage } from './work.cjs';
16
+ export interface Superpixels {
17
+ /** Superpixel of each work pixel. */
18
+ label: Int32Array;
19
+ count: number;
20
+ /** Mean L*a*b* per superpixel, 3 values each. */
21
+ lab: Float64Array;
22
+ /** Mean position per superpixel, in work pixels, 2 values each. */
23
+ centre: Float64Array;
24
+ size: Int32Array;
25
+ }
26
+ /** SLIC superpixels of the work image: about `target` of them, `compactness` 10 (L*a*b* units). */
27
+ export declare function slicSuperpixels(work: WorkImage, target?: number, compactness?: number, rounds?: number): Superpixels;
28
+ /** Saliency 0..1 of each superpixel (see the module comment). */
29
+ export declare function superpixelSaliency(sp: Superpixels, width: number, height: number): Float64Array;
30
+ /** Otsu's threshold of `values` (0..1) weighted by `weights`. */
31
+ export declare function otsuThreshold(values: ArrayLike<number>, weights: ArrayLike<number>): number;
32
+ /** What {@link findSubject} found. */
33
+ export interface FoundSubject {
34
+ selection: SelectionMask;
35
+ /** Why nothing was selected, when nothing was. */
36
+ reason?: string;
37
+ }
38
+ /**
39
+ * The most salient subject of `pixels` as a selection of the whole image (empty, with a reason,
40
+ * when nothing stands out from the background).
41
+ */
42
+ export declare function findSubject(pixels: PixelBuffer, options?: {
43
+ enhanceEdge?: boolean;
44
+ }): FoundSubject;
@@ -0,0 +1,44 @@
1
+ /**
2
+ * Select Subject without a segmentation model: the most salient subject, found classically.
3
+ *
4
+ * 1. SLIC superpixels (Achanta et al., 2012) group the reduced image into a few hundred patches of
5
+ * similar colour.
6
+ * 2. Each patch's saliency is how unlike the image's border it is (the border is mostly
7
+ * background), times how much it contrasts with the patches around it (region contrast, Cheng
8
+ * et al., 2015), times a mild preference for the centre.
9
+ * 3. Otsu's threshold splits the patches into a first guess at the subject.
10
+ * 4. GrabCut refines that guess along the image's edges, with the clearly-background border fixed.
11
+ *
12
+ * It cannot tell which object a description names: it selects what stands out.
13
+ */
14
+ import type { PixelBuffer, SelectionMask } from '../mask.js';
15
+ import { type WorkImage } from './work.js';
16
+ export interface Superpixels {
17
+ /** Superpixel of each work pixel. */
18
+ label: Int32Array;
19
+ count: number;
20
+ /** Mean L*a*b* per superpixel, 3 values each. */
21
+ lab: Float64Array;
22
+ /** Mean position per superpixel, in work pixels, 2 values each. */
23
+ centre: Float64Array;
24
+ size: Int32Array;
25
+ }
26
+ /** SLIC superpixels of the work image: about `target` of them, `compactness` 10 (L*a*b* units). */
27
+ export declare function slicSuperpixels(work: WorkImage, target?: number, compactness?: number, rounds?: number): Superpixels;
28
+ /** Saliency 0..1 of each superpixel (see the module comment). */
29
+ export declare function superpixelSaliency(sp: Superpixels, width: number, height: number): Float64Array;
30
+ /** Otsu's threshold of `values` (0..1) weighted by `weights`. */
31
+ export declare function otsuThreshold(values: ArrayLike<number>, weights: ArrayLike<number>): number;
32
+ /** What {@link findSubject} found. */
33
+ export interface FoundSubject {
34
+ selection: SelectionMask;
35
+ /** Why nothing was selected, when nothing was. */
36
+ reason?: string;
37
+ }
38
+ /**
39
+ * The most salient subject of `pixels` as a selection of the whole image (empty, with a reason,
40
+ * when nothing stands out from the background).
41
+ */
42
+ export declare function findSubject(pixels: PixelBuffer, options?: {
43
+ enhanceEdge?: boolean;
44
+ }): FoundSubject;
@@ -1,6 +1,6 @@
1
1
  /**
2
- * The reduced copy of the image the graph segmentations (Quick Selection, Object Selection) work
3
- * on, and scaling their result back up to the image with an anti-aliased edge.
2
+ * The reduced copy of the image the segmentations (Quick, Object and Subject Selection, Focus
3
+ * Area) work on, and scaling their result back up to the image.
4
4
  */
5
5
  import { type PixelBuffer, type SelectionMask } from '../mask.cjs';
6
6
  /** The reduced image the segmentations work on (sRGB, 0..255 per channel). */
@@ -1,6 +1,6 @@
1
1
  /**
2
- * The reduced copy of the image the graph segmentations (Quick Selection, Object Selection) work
3
- * on, and scaling their result back up to the image with an anti-aliased edge.
2
+ * The reduced copy of the image the segmentations (Quick, Object and Subject Selection, Focus
3
+ * Area) work on, and scaling their result back up to the image.
4
4
  */
5
5
  import { type PixelBuffer, type SelectionMask } from '../mask.js';
6
6
  /** The reduced image the segmentations work on (sRGB, 0..255 per channel). */
@@ -47,6 +47,12 @@ export interface SelectionToolOptions {
47
47
  objectSampleAll?: boolean;
48
48
  /** Object Selection: smoother, less blocky edges (Auto-Enhance; default false). */
49
49
  objectEnhance?: boolean;
50
+ /** Focus Area: In-Focus Range 0..100 (default 50). */
51
+ focusRange?: number;
52
+ /** Focus Area: Image Noise Level 0..100 (default 0). */
53
+ focusNoise?: number;
54
+ /** Focus Area: soften the edge over this many pixels (default 4). */
55
+ focusSoftness?: number;
50
56
  /** Type Mask: the text to select (default "Type"). A click places its first baseline. */
51
57
  typeText?: string;
52
58
  /** Type Mask: font size in px (default 72). */
@@ -47,6 +47,12 @@ export interface SelectionToolOptions {
47
47
  objectSampleAll?: boolean;
48
48
  /** Object Selection: smoother, less blocky edges (Auto-Enhance; default false). */
49
49
  objectEnhance?: boolean;
50
+ /** Focus Area: In-Focus Range 0..100 (default 50). */
51
+ focusRange?: number;
52
+ /** Focus Area: Image Noise Level 0..100 (default 0). */
53
+ focusNoise?: number;
54
+ /** Focus Area: soften the edge over this many pixels (default 4). */
55
+ focusSoftness?: number;
50
56
  /** Type Mask: the text to select (default "Type"). A click places its first baseline. */
51
57
  typeText?: string;
52
58
  /** Type Mask: font size in px (default 72). */
@@ -23,8 +23,8 @@ export interface ImageSegmentationToolProviderOptions {
23
23
  /** The `select_subject` tool: Select › Subject through the controller's segmentation provider. */
24
24
  export declare function createImageSubjectSelectionTool(controller: ImageEditorController): AgentTool;
25
25
  /**
26
- * Agent tools that need the controller's segmentation provider (`select_subject`). The list is
27
- * empty while no provider is set, so a host can register this once and the tool appears when a
28
- * model is available.
26
+ * @deprecated `select_subject` is now one of the selection tools of `createImageEditorToolProvider`
27
+ * (it works without a model too), so this provider lists no tools; it stays so hosts that register
28
+ * it keep working. Remove it from your registry.
29
29
  */
30
30
  export declare function createImageSegmentationToolProvider(controller: ImageEditorController, options?: ImageSegmentationToolProviderOptions): AgentToolProvider;
@@ -23,8 +23,8 @@ export interface ImageSegmentationToolProviderOptions {
23
23
  /** The `select_subject` tool: Select › Subject through the controller's segmentation provider. */
24
24
  export declare function createImageSubjectSelectionTool(controller: ImageEditorController): AgentTool;
25
25
  /**
26
- * Agent tools that need the controller's segmentation provider (`select_subject`). The list is
27
- * empty while no provider is set, so a host can register this once and the tool appears when a
28
- * model is available.
26
+ * @deprecated `select_subject` is now one of the selection tools of `createImageEditorToolProvider`
27
+ * (it works without a model too), so this provider lists no tools; it stays so hosts that register
28
+ * it keep working. Remove it from your registry.
29
29
  */
30
30
  export declare function createImageSegmentationToolProvider(controller: ImageEditorController, options?: ImageSegmentationToolProviderOptions): AgentToolProvider;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pixerate/editor",
3
- "version": "0.198.0",
3
+ "version": "0.200.0",
4
4
  "description": "UI-agnostic rich text and media editing core library",
5
5
  "author": "Pixerate",
6
6
  "license": "MIT",
@@ -221,7 +221,7 @@ in the source frame at the document's bit depth, colour mode and profile. Read
221
221
  | `list_controls` | Get every base control (id, label, section, min, max, step, default, `requiresProcess`), each layer kind's settable controls (plus `opacity`), the blend mode ids and the `layers.<layerId>.<controlId>` path format. Call once per session before writing. |
222
222
  | `get_selection` | Read the active selection: `empty`, `bounds` (natural pixels), `area` in pixels, `percent` of the image and a description. Check it after every select or modify step and before masking: a wand that covered 90% of the image is the wrong selection. |
223
223
  | `list_channels` | Read the alpha channels (saved selections): id, name, bounds, percent, overlay and visibility, and whether Quick Mask mode is on. |
224
- | `select_subject` | Select › Subject (only when the host has a segmentation model): `target` describes what to select ("the dog", "the sky"); an AI model finds the matching objects and selects their outlines, combined by `mode`. `maxSegments` 1 for a single subject. Returns the selection and `found` (label, bounds per object); nothing found leaves the selection unchanged. |
224
+ | `select_subject` | Select › Subject. With a host segmentation model, `target` describes what to select ("the dog", "the sky") and the model's outlines are selected (`maxSegments` 1 for one). Without one, the subject that stands out most is found classically; `target` can't choose it (`method: "saliency"`, `note`). Combined by `mode`. Returns the selection, `found` (label, bounds) and `method`; nothing found leaves the selection unchanged. |
225
225
  | `list_layers` | Read the layer stack bottom to top as a tree: id, type (`pixel`, `adjustment`, `group`, `shape`, `annotation`, `smart`; smart objects add their `contents`, `smartFilters` and `filterMask`; shapes a `shape` summary of component ops and kinds and paint types, and `annotation` when migrated from one), name, document `bounds` of pixel layers, visibility, opacity, `fillOpacity`, blend, `clipped`, locks, a `mask` summary, an `effects` summary (master switch, scale, effect ids and kinds), pixel-layer `filters` (the Background's `develop` filter is the base adjustments), adjustment `kind` and `params`, group `children`, and which layer is `active`. Call it to understand a document with more than the Background before changing it; adjustment layer ids work with every adjustment-layer tool. |
226
226
  | `list_layer_effects` | Read one layer's effects: `enabled` (master switch), `scale` (Scale Effects), `margin` (px they reach beyond the shape), `fromPsd`, and every effect with `id`, `kind`, `label` and all its settings. Also returns the `globalLight`, the `patterns` pattern effects can use and the effect `kinds`. Call before changing effects you did not add. |
227
227
  | `get_image_info` | Read the geometry: source `image` size, `crop` box (source pixels, or null), `rotation` degrees, `flipH` / `flipV`, the `output` size after crop and rotation, `bitDepth` (8, 16 or 32), the layer count and `canUndo` / `canRedo`. Call before cropping or selecting so coordinates are right. |
@@ -254,6 +254,7 @@ in the source frame at the document's bit depth, colour mode and profile. Read
254
254
  | `select_line` | Single row or column marquee: `orientation` `row` (at y) or `column` (at x), `position` in natural px, `mode`. A 1 px line across the image. Returns the summary. |
255
255
  | `quick_select` | Quick Selection: `strokes` (brush paths of `{x, y}`), `size` (diameter, default 30), `mode`, `sampleAllLayers`, `enhanceEdge`. Each stroke grows out to its region's edges; with `replace` the first replaces and the rest add. Paint inside the area, then check and fix with `add` / `subtract` strokes. Returns the summary. |
256
256
  | `select_object` | Object Selection (GrabCut): `rect` (a box around the object) or `point` (on it), `mode`, `sampleAllLayers`, `enhanceEdge`. Outside the box is background. Make the box a little larger than the object. Returns the summary. |
257
+ | `select_focus_area` | Select › Focus Area: the in-focus (sharp) parts, edge fitted to the image. `range` 0..100 (higher takes in softer areas), `noise` 0..100 (raise when grain is selected), `softness` px, `mode`. Returns the summary and `noiseLevel`. |
257
258
  | `select_polygon` | The lasso: `points` (at least 3 `{x, y}` along the outline, closed automatically), `mode`, `feather`, `antiAlias`; `snapToEdges: {width, contrast}` makes it the Magnetic Lasso (points snap to edges, the outline follows them). Trace a subject's contour, not its box. Returns the summary (plus `outlinePoints` when snapped). |
258
259
  | `magic_wand` | Select similar colour from `x`, `y`: `tolerance` 0..255 (default 32), `contiguous` (default true), `distance` `rgb` or `perceptual`, `sampleMerged`, `sample` (`composite` or `active-layer`), `mode`, `feather`. For flat backdrops and solid colours. Returns the summary. |
259
260
  | `select_color_range` | Color Range, soft: `samples` (`[{color, x?, y?}]`) or a `preset` (reds … magentas, highlights, midtones, shadows, skinTones); `fuzziness` (samples 0..200, default 40; tone presets' falloff, default 20), `localized` px radius around positioned samples, `invert`, `sample`, `mode`, `feather`. Returns the summary. |
@@ -97,8 +97,9 @@ This skill is the method. `pixerate-image-editor` has the full tool reference.
97
97
  | --- | --- |
98
98
  | Geometric areas: a frame, a screen, a band | `select_rect` / `select_ellipse`, with `feather` for soft transitions |
99
99
  | 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 |
100
- | A subject with a clear outline (product, person, animal) | `select_subject` if the host has a model; else `select_object` around it, or `select_polygon` with `snapToEdges` (12–30 points within `width` of the edge), then `refine_selection` |
100
+ | 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` |
101
101
  | 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 |
102
+ | 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 |
102
103
  | A low-contrast or busy outline the edges don't follow | `select_polygon` without `snapToEdges`, along the contour (20–60 points) |
103
104
  | Flat backdrop or solid colour (studio white, green screen, sky without clouds) | `magic_wand` on the backdrop (`tolerance` 20–40; `distance: "perceptual"` for gradients), then `invert_selection` |
104
105
  | A colour spread across the image (all the reds, a dress) | `select_color_range` with `samples` (several picks) or a hue `preset`; `localized` to keep one area |
@@ -158,6 +159,9 @@ This skill is the method. `pixerate-image-editor` has the full tool reference.
158
159
  30–60), check `percent`, and grow with `mode: "add"`.
159
160
  - **Box instead of outline:** `select_rect` around a subject masks its background too. Trace
160
161
  the contour.
162
+ - **Select Subject without a model picks the wrong thing:** it selects what stands out most from
163
+ the image's border, which may be a bright sign rather than the person. When `method` is
164
+ `saliency`, check with `capture_view`; if it's wrong, use `select_object` with a box.
161
165
  - **Object Selection takes part of the background:** inside the box, anything that looks
162
166
  unlike the background around the box counts as the object. Tighten the box, or `subtract` a
163
167
  `quick_select` stroke on the extra. With `point`, it may stop at an inner edge of a
@@ -200,6 +204,7 @@ This skill is the method. `pixerate-image-editor` has the full tool reference.
200
204
  - `select_polygon`: the lasso, along a contour; with `snapToEdges`, the Magnetic Lasso
201
205
  - `quick_select`: brush strokes that grow out to the region's edges
202
206
  - `select_object`: the object in a box or under a point
207
+ - `select_focus_area`: what is in focus
203
208
  - `select_line`: a single row or column
204
209
  - `select_layer_transparency`: a layer's own pixels
205
210
  - `grow_selection`, `select_similar`: add similar colour, connected or anywhere
@@ -212,7 +217,7 @@ This skill is the method. `pixerate-image-editor` has the full tool reference.
212
217
  - `fill_pixels`, `blur_stroke`: fill or soften the selection in Quick Mask mode
213
218
  - `magic_wand`: similar colour from a seed
214
219
  - `select_color_range`: colour samples, hue, tone and skin presets
215
- - `select_subject`: a subject by description (needs a host model)
220
+ - `select_subject`: a subject by description with a host model; without one, the most salient subject
216
221
  - `load_selection_from_image`: AI or saved mattes
217
222
  - `load_selection_from_mask`: a layer mask back to a selection
218
223
  - `set_selection_display`: ants, Quick Mask tint or hidden