---
title: "channel.new: New Channel… — Photo kit command — Kition"
description: "Adds an alpha channel named `name`, filled black, white or from the selection, with its overlay `color` and `opacity`."
canonical: "https://developer.kition.ai/docs/kits/photo/commands/channel.new"
---

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

# channel.new

**New Channel….** Adds an alpha channel named `name`, filled black, white or from the selection, with its overlay `color` and `opacity`.

- 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 |
| --- | --- | --- | --- |
| `coalesce` | `string` | no | Merges consecutive edits with the same key into one undo step, as a slider drag or a typing session is one. |
| `color` | `string` | no | like #rrggbb |
| `fill` | `"black" \| "white" \| "selection"` | no |  |
| `indicates` | `"masked" \| "selected"` | no |  |
| `name` | `string` | no |  |
| `opacity` | `integer` | no | 0 to 100 |
| `region` | `object` | no | Where the command acts, for this call only: {"rect": [x, y, width, height]}, {"ellipse": [x, y, width, height]}, {"polygon": [[x, y], …]} (3 points or more), {"layer": id} (that layer's pixels, by their opacity), {"channel": name or index} (a saved selection or alpha channel), or "all"; add "invert": true to take everything else. Without it, inside the current selection (made with select.* earlier in the run), or everywhere when there is none. |

## Call through photo_run

```text
photo_run {
  "path": "<file>.psd",
  "steps": [{ "command": "channel.new" }]
}
```

The required parameters, with placeholders for their types: not a tested example. Optional: `coalesce`, `color`, `fill`, `indicates`, `name`, `opacity`, `region`. 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": {
    "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"
    },
    "color": {
      "default": "#ff0000",
      "description": "like #rrggbb",
      "type": "string"
    },
    "fill": {
      "default": "black",
      "enum": [
        "black",
        "white",
        "selection"
      ],
      "type": "string"
    },
    "indicates": {
      "default": "masked",
      "enum": [
        "masked",
        "selected"
      ],
      "type": "string"
    },
    "name": {
      "type": "string"
    },
    "opacity": {
      "default": 50,
      "description": "0 to 100",
      "type": "integer"
    },
    "region": {
      "description": "Where the command acts, for this call only: {\"rect\": [x, y, width, height]}, {\"ellipse\": [x, y, width, height]}, {\"polygon\": [[x, y], …]} (3 points or more), {\"layer\": id} (that layer's pixels, by their opacity), {\"channel\": name or index} (a saved selection or alpha channel), or \"all\"; add \"invert\": true to take everything else. Without it, inside the current selection (made with select.* earlier in the run), or everywhere when there is none.",
      "properties": {
        "channel": {
          "x-khp-name": "name",
          "x-khp-role": "object",
          "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).
