Photo kit command

select.transformSelection

Transform Selection

Moves, scales, rotates or distorts the selection outline itself (`dx`/`dy`, `scaleX`/`scaleY`, `rotate`, skew, `matrix` or `corners`); the pixels stay.

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

Parameters

Parameters of select.transformSelection
NameTypeRequiredDescription
bendnumbernopercent; default 50
coalescestringnoMerges consecutive edits with the same key into one undo step, as a slider drag or a typing session is one.
cornersany[]no[[x,y]×4]? (where the frame's corners go: distort/perspective); where the frame's corners go: distort/perspective; one of several alternative parameters
dxnumbernopixels
dynumbernopixels
gridnumber[]no[cols, rows]
hDistortnumbernopercent; default 0
interpolation"bilinear" | "bicubic" | "nearest"no
matrixnumber[]no[a, b, c, d, e, f]
meshobjectno(3c+1)×(3r+1) control points, row-major, document px
quadanynoone of several alternative parameters
rectnumber[]no[x0, y0, x1, y1]; frame; default = selection bounds
referenceanyno"center|topLeft|top|topRight|left|right|bottomLeft|bottom|bottomRight"|[x,y]="center"; default "center"
rotatenumbernodegrees
scaleXnumbernopercent
scaleYnumbernopercent
skewXnumbernodegrees
skewYnumbernodegrees
style"custom" | "none" | "arc" | "arcLower" | "arcUpper" | "arch" | "bulge" | "shellLower" | "shellUpper" | "flag" | "wave" | "fish" | "rise" | "fisheye" | "inflate" | "squeeze" | "twist"noa warp, as edit.transform.warp
vDistortnumbernopercent; default 0
verticalbooleannodefault false
warpobjectnoa full warp object

Call through photo_run

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

The required parameters, with placeholders for their types: not a tested example. Optional: bend, coalesce, corners, dx, dy, grid, hDistort, interpolation, matrix, mesh, quad, rect, reference, rotate, scaleX, scaleY, skewX, skewY, style, vDistort, vertical, warp. 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": {
    "bend": {
      "description": "percent; default 50",
      "type": "number"
    },
    "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"
    },
    "corners": {
      "description": "[[x,y]×4]? (where the frame's corners go: distort/perspective); where the frame's corners go: distort/perspective; one of several alternative parameters",
      "items": {},
      "type": "array"
    },
    "dx": {
      "default": 0,
      "description": "pixels",
      "type": "number"
    },
    "dy": {
      "default": 0,
      "description": "pixels",
      "type": "number"
    },
    "grid": {
      "description": "[cols, rows]",
      "items": {
        "type": "number"
      },
      "type": "array"
    },
    "hDistort": {
      "description": "percent; default 0",
      "type": "number"
    },
    "interpolation": {
      "default": "bilinear",
      "enum": [
        "bilinear",
        "bicubic",
        "nearest"
      ],
      "type": "string"
    },
    "matrix": {
      "description": "[a, b, c, d, e, f]",
      "items": {
        "type": "number"
      },
      "type": "array"
    },
    "mesh": {
      "additionalProperties": true,
      "description": "(3c+1)×(3r+1) control points, row-major, document px",
      "properties": {
        "points": {
          "type": "array"
        },
        "us": {
          "description": "[0, 1]",
          "items": {
            "type": "number"
          },
          "type": "array"
        },
        "vs": {
          "description": "[0, 1]",
          "items": {
            "type": "number"
          },
          "type": "array"
        }
      },
      "type": "object"
    },
    "quad": {
      "description": "one of several alternative parameters"
    },
    "rect": {
      "description": "[x0, y0, x1, y1]; frame; default = selection bounds",
      "items": {
        "type": "number"
      },
      "type": "array"
    },
    "reference": {
      "description": "\"center|topLeft|top|topRight|left|right|bottomLeft|bottom|bottomRight\"|[x,y]=\"center\"; default \"center\""
    },
    "rotate": {
      "default": 0,
      "description": "degrees",
      "type": "number"
    },
    "scaleX": {
      "default": 100,
      "description": "percent",
      "type": "number"
    },
    "scaleY": {
      "default": 100,
      "description": "percent",
      "type": "number"
    },
    "skewX": {
      "default": 0,
      "description": "degrees",
      "type": "number"
    },
    "skewY": {
      "default": 0,
      "description": "degrees",
      "type": "number"
    },
    "style": {
      "description": "a warp, as edit.transform.warp",
      "enum": [
        "custom",
        "none",
        "arc",
        "arcLower",
        "arcUpper",
        "arch",
        "bulge",
        "shellLower",
        "shellUpper",
        "flag",
        "wave",
        "fish",
        "rise",
        "fisheye",
        "inflate",
        "squeeze",
        "twist"
      ],
      "type": "string"
    },
    "vDistort": {
      "description": "percent; default 0",
      "type": "number"
    },
    "vertical": {
      "description": "default false",
      "type": "boolean"
    },
    "warp": {
      "additionalProperties": true,
      "description": "a full warp object",
      "type": "object"
    }
  },
  "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.