---
title: "image.calculations: Calculations… — Photo kit command — Kition"
description: "Blends two source channels with `blending` and writes the result as a new channel, a new document or a selection (`result`)."
canonical: "https://developer.kition.ai/docs/kits/photo/commands/image.calculations"
---

> Canonical HTML: [https://developer.kition.ai/docs/kits/photo/commands/image.calculations](https://developer.kition.ai/docs/kits/photo/commands/image.calculations)

# 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); reference: [Photo kit commands](https://developer.kition.ai/docs/kits/photo.md)
- Changes the document: yes

## Parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `blending` | `string` | no | for example multiply |
| `coalesce` | `string` | no | Merges consecutive edits with the same key into one undo step, as a slider drag or a typing session is one. |
| `mask` | `object` | no |  |
| `maskChannel` | `any` | no |  |
| `name` | `string` | no |  |
| `offset` | `integer` | no | -255 to 255 |
| `opacity` | `integer` | no | 0 to 100 |
| `result` | `"newChannel" \| "newDocument" \| "selection"` | no |  |
| `scale` | `integer` | no | 1 to 2 |
| `source1` | `object` | no | {"document","layer","channel","invert"} |
| `source1Channel` | `any` | no |  |
| `source2` | `object` | no |  |
| `source2Channel` | `any` | no |  |

## 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/photo-darwin-arm64@0.1.0 and the kit itself (photo_commands through @kition/cli@0.1.1, built from KitionAI/kition-photo@abe3f30).
