Photo kit command

image.calculations

Calculations…

Blends two source channels with `blending` and writes the result as a new channel, a new document or a selection (`result`).

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

Parameters

Parameters of image.calculations
NameTypeRequiredDescription
blendingstringnofor example multiply
coalescestringnoMerges consecutive edits with the same key into one undo step, as a slider drag or a typing session is one.
maskobjectno
maskChannelanyno
namestringno
offsetintegerno-255 to 255
opacityintegerno0 to 100
result"newChannel" | "newDocument" | "selection"no
scaleintegerno1 to 2
source1objectno{"document","layer","channel","invert"}
source1Channelanyno
source2objectno
source2Channelanyno

Call through photo_run

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

The required parameters, with placeholders for their types: not a tested example. Optional: blending, coalesce, mask, maskChannel, name, offset, opacity, result, scale, source1, source1Channel, source2, source2Channel. photo_run answers the step’s result in completed[i].result.

Result

The kit gives no result schema for this command.

Parameter schema

json
{
  "additionalProperties": false,
  "properties": {
    "blending": {
      "default": "multiply",
      "description": "for example multiply",
      "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"
    },
    "mask": {
      "additionalProperties": true,
      "properties": {
        "channel": {
          "x-khp-name": "name",
          "x-khp-role": "object",
          "x-khp-types": [
            "Channel"
          ]
        }
      },
      "type": "object"
    },
    "maskChannel": {
      "x-khp-name": "name",
      "x-khp-types": [
        "Channel"
      ]
    },
    "name": {
      "type": "string"
    },
    "offset": {
      "default": 0,
      "description": "-255 to 255",
      "type": "integer"
    },
    "opacity": {
      "default": 100,
      "description": "0 to 100",
      "type": "integer"
    },
    "result": {
      "default": "newChannel",
      "enum": [
        "newChannel",
        "newDocument",
        "selection"
      ],
      "type": "string"
    },
    "scale": {
      "default": 1,
      "description": "1 to 2",
      "type": "integer"
    },
    "source1": {
      "additionalProperties": true,
      "description": "{\"document\",\"layer\",\"channel\",\"invert\"}",
      "properties": {
        "channel": {
          "x-khp-name": "name",
          "x-khp-role": "object",
          "x-khp-types": [
            "Channel"
          ]
        },
        "document": {},
        "invert": {},
        "layer": {
          "type": "integer",
          "x-khp-role": "object"
        }
      },
      "type": "object"
    },
    "source1Channel": {
      "x-khp-name": "name",
      "x-khp-types": [
        "Channel"
      ]
    },
    "source2": {
      "additionalProperties": true,
      "properties": {
        "channel": {
          "x-khp-name": "name",
          "x-khp-role": "object",
          "x-khp-types": [
            "Channel"
          ]
        }
      },
      "type": "object"
    },
    "source2Channel": {
      "x-khp-name": "name",
      "x-khp-types": [
        "Channel"
      ]
    }
  },
  "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.