Photo kit command

select.magneticLasso

Magnetic Lasso

Selects along edges between `points`, snapping to edges of `contrast` within `width` px (`trace`), like the magnetic lasso; `mode` replaces, adds to, subtracts from or intersects the current selection.

Kit
Photo 0.1.0 (PSD, PSB, or .kphoto)
Changes the document
no

Parameters

Parameters of select.magneticLasso
NameTypeRequiredDescription
antiAliasbooleanno
close"magnetic" | "straight"nohow the last point joins the first
coalescestringnoMerges consecutive edits with the same key into one undo step, as a slider drag or a typing session is one.
contrastintegerno1 to 100; %: weaker edges are ignored
featherintegerno0 to 1000; px
mode"replace" | "add" | "subtract" | "intersect"no
pointsnumber[][]no≥3 fastening points in order; with trace=false, the finished outline
tracebooleanno
widthintegerno1 to 256; px: follows edges this close to the points

Call through photo_run

text
photo_run {
  "path": "<file>.psd",
  "steps": [{ "command": "select.magneticLasso" }]
}

The required parameters, with placeholders for their types: not a tested example. Optional: antiAlias, close, coalesce, contrast, feather, mode, points, trace, width. photo_run answers the step’s result in completed[i].result.

Result

Result JSON Schema
json
{
  "additionalProperties": true,
  "description": "an object; the command's description says what it holds",
  "properties": {},
  "type": "object"
}

Parameter schema

json
{
  "additionalProperties": false,
  "properties": {
    "antiAlias": {
      "default": true,
      "type": "boolean"
    },
    "close": {
      "default": "magnetic",
      "description": "how the last point joins the first",
      "enum": [
        "magnetic",
        "straight"
      ],
      "type": "string"
    },
    "coalesce": {
      "description": "Merges consecutive edits with the same key into one undo step, as a slider drag or a typing session is one.",
      "type": "string"
    },
    "contrast": {
      "default": 10,
      "description": "1 to 100; %: weaker edges are ignored",
      "type": "integer"
    },
    "feather": {
      "default": 0,
      "description": "0 to 1000; px",
      "type": "integer"
    },
    "mode": {
      "default": "replace",
      "enum": [
        "replace",
        "add",
        "subtract",
        "intersect"
      ],
      "type": "string"
    },
    "points": {
      "description": "≥3 fastening points in order; with trace=false, the finished outline",
      "items": {
        "items": {
          "type": "number"
        },
        "type": "array"
      },
      "type": "array"
    },
    "trace": {
      "default": true,
      "type": "boolean"
    },
    "width": {
      "default": 10,
      "description": "1 to 256; px: follows edges this close to the points",
      "type": "integer"
    }
  },
  "type": "object"
}

Generated from the command list of @kition/[email protected] and the kit itself (photo_commands through @kition/[email protected], built from KitionAI/kition-photo@abe3f30). As data: commands.jsonl.