@pixerate/editor 0.199.0 → 0.201.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.
@@ -2,6 +2,8 @@ import { AdjustmentKind, AdjustmentLayer, AdjustmentParamsMap, Annotation, Creat
2
2
  import { type PathToSelectionOptions, type SelectionToPathOptions } from './selection/path.cjs';
3
3
  import { type MagneticEdgeOptions } from './selection/magnetic.cjs';
4
4
  import { type ObjectTarget } from './selection/segment/grabcut.cjs';
5
+ import { type FocusAreaOptions } from './selection/segment/focus.cjs';
6
+ import { type SkyOptions } from './selection/segment/sky.cjs';
5
7
  import { RenderOptions } from './renderer.cjs';
6
8
  import { type BlendMode } from './blend.cjs';
7
9
  import type { ImageHistogram } from './histogram.cjs';
@@ -152,6 +154,20 @@ export interface QuickSelectCommandOptions {
152
154
  /** Smoother, less blocky edges (Photoshop's Auto-Enhance). Default false. */
153
155
  enhanceEdge?: boolean;
154
156
  }
157
+ /** Options of {@link ImageEditorController.selectFocusArea}. */
158
+ export interface FocusAreaCommandOptions extends FocusAreaOptions {
159
+ /** How the area combines with the selection (default `replace`). */
160
+ mode?: SelectionMode;
161
+ /** Sample every layer (default true) or only the active pixel layer. */
162
+ sampleAllLayers?: boolean;
163
+ }
164
+ /** Options of {@link ImageEditorController.selectSky}. */
165
+ export interface SkyCommandOptions extends SkyOptions {
166
+ /** How the sky combines with the selection (default `replace`). */
167
+ mode?: SelectionMode;
168
+ /** Sample every layer (default true) or only the active pixel layer. */
169
+ sampleAllLayers?: boolean;
170
+ }
155
171
  /** Options of {@link ImageEditorController.selectObject}. */
156
172
  export interface SelectObjectCommandOptions {
157
173
  /** How the object combines with the selection (default `replace`). */
@@ -1540,6 +1556,25 @@ export declare class ImageEditorController {
1540
1556
  * Resolves to the resulting selection.
1541
1557
  */
1542
1558
  selectObject(target: ObjectTarget, options?: SelectObjectCommandOptions): Promise<SelectionMask | null>;
1559
+ /**
1560
+ * Select › Focus Area: selects the parts of the image that are in focus (fine detail above the
1561
+ * image's noise), fitted to its edges, combined with the selection by `mode` as one undo step.
1562
+ * Resolves to the selection and the noise level measured (σ of luminance in levels).
1563
+ */
1564
+ selectFocusArea(options?: FocusAreaCommandOptions): Promise<{
1565
+ selection: SelectionMask | null;
1566
+ noiseLevel: number;
1567
+ }>;
1568
+ /**
1569
+ * Select › Sky: selects the sky (blue, or bright and grey when overcast; smooth; grown down from
1570
+ * the top of the image, with patches seen through gaps), fitted to its edges, combined with the
1571
+ * selection by `mode` as one undo step. Resolves to the selection and, when no sky was found
1572
+ * (the selection is then unchanged), why.
1573
+ */
1574
+ selectSky(options?: SkyCommandOptions): Promise<{
1575
+ selection: SelectionMask | null;
1576
+ note?: string;
1577
+ }>;
1543
1578
  /**
1544
1579
  * Supplies the pixels the selection tools sample (natural size RGBA), e.g. decoded in a worker
1545
1580
  * or in a test; `null` goes back to reading the source image. Without a canvas (Node, workers)
@@ -2,6 +2,8 @@ import { AdjustmentKind, AdjustmentLayer, AdjustmentParamsMap, Annotation, Creat
2
2
  import { type PathToSelectionOptions, type SelectionToPathOptions } from './selection/path.js';
3
3
  import { type MagneticEdgeOptions } from './selection/magnetic.js';
4
4
  import { type ObjectTarget } from './selection/segment/grabcut.js';
5
+ import { type FocusAreaOptions } from './selection/segment/focus.js';
6
+ import { type SkyOptions } from './selection/segment/sky.js';
5
7
  import { RenderOptions } from './renderer.js';
6
8
  import { type BlendMode } from './blend.js';
7
9
  import type { ImageHistogram } from './histogram.js';
@@ -152,6 +154,20 @@ export interface QuickSelectCommandOptions {
152
154
  /** Smoother, less blocky edges (Photoshop's Auto-Enhance). Default false. */
153
155
  enhanceEdge?: boolean;
154
156
  }
157
+ /** Options of {@link ImageEditorController.selectFocusArea}. */
158
+ export interface FocusAreaCommandOptions extends FocusAreaOptions {
159
+ /** How the area combines with the selection (default `replace`). */
160
+ mode?: SelectionMode;
161
+ /** Sample every layer (default true) or only the active pixel layer. */
162
+ sampleAllLayers?: boolean;
163
+ }
164
+ /** Options of {@link ImageEditorController.selectSky}. */
165
+ export interface SkyCommandOptions extends SkyOptions {
166
+ /** How the sky combines with the selection (default `replace`). */
167
+ mode?: SelectionMode;
168
+ /** Sample every layer (default true) or only the active pixel layer. */
169
+ sampleAllLayers?: boolean;
170
+ }
155
171
  /** Options of {@link ImageEditorController.selectObject}. */
156
172
  export interface SelectObjectCommandOptions {
157
173
  /** How the object combines with the selection (default `replace`). */
@@ -1540,6 +1556,25 @@ export declare class ImageEditorController {
1540
1556
  * Resolves to the resulting selection.
1541
1557
  */
1542
1558
  selectObject(target: ObjectTarget, options?: SelectObjectCommandOptions): Promise<SelectionMask | null>;
1559
+ /**
1560
+ * Select › Focus Area: selects the parts of the image that are in focus (fine detail above the
1561
+ * image's noise), fitted to its edges, combined with the selection by `mode` as one undo step.
1562
+ * Resolves to the selection and the noise level measured (σ of luminance in levels).
1563
+ */
1564
+ selectFocusArea(options?: FocusAreaCommandOptions): Promise<{
1565
+ selection: SelectionMask | null;
1566
+ noiseLevel: number;
1567
+ }>;
1568
+ /**
1569
+ * Select › Sky: selects the sky (blue, or bright and grey when overcast; smooth; grown down from
1570
+ * the top of the image, with patches seen through gaps), fitted to its edges, combined with the
1571
+ * selection by `mode` as one undo step. Resolves to the selection and, when no sky was found
1572
+ * (the selection is then unchanged), why.
1573
+ */
1574
+ selectSky(options?: SkyCommandOptions): Promise<{
1575
+ selection: SelectionMask | null;
1576
+ note?: string;
1577
+ }>;
1543
1578
  /**
1544
1579
  * Supplies the pixels the selection tools sample (natural size RGBA), e.g. decoded in a worker
1545
1580
  * or in a test; `null` goes back to reading the source image. Without a canvas (Node, workers)