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
| Name | Type | Required | Description |
|---|---|---|---|
bend | number | no | percent; default 50 |
coalesce | string | no | Merges consecutive edits with the same key into one undo step, as a slider drag or a typing session is one. |
corners | any[] | 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 |
dx | number | no | pixels |
dy | number | no | pixels |
grid | number[] | no | [cols, rows] |
hDistort | number | no | percent; default 0 |
interpolation | "bilinear" | "bicubic" | "nearest" | no | |
matrix | number[] | no | [a, b, c, d, e, f] |
mesh | object | no | (3c+1)×(3r+1) control points, row-major, document px |
quad | any | no | one of several alternative parameters |
rect | number[] | no | [x0, y0, x1, y1]; frame; default = selection bounds |
reference | any | no | "center|topLeft|top|topRight|left|right|bottomLeft|bottom|bottomRight"|[x,y]="center"; default "center" |
rotate | number | no | degrees |
scaleX | number | no | percent |
scaleY | number | no | percent |
skewX | number | no | degrees |
skewY | number | no | degrees |
style | "custom" | "none" | "arc" | "arcLower" | "arcUpper" | "arch" | "bulge" | "shellLower" | "shellUpper" | "flag" | "wave" | "fish" | "rise" | "fisheye" | "inflate" | "squeeze" | "twist" | no | a warp, as edit.transform.warp |
vDistort | number | no | percent; default 0 |
vertical | boolean | no | default false |
warp | object | no | a 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.