Photo kit command

file.new

New…

Creates a new document of `width` × `height` pixels (resolution, color mode, background) and makes it the active one.

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

Parameters

Parameters of file.new
NameTypeRequiredDescription
background"white" | "black" | "backgroundColor" | "transparent" | "#rrggbb"no
backgroundColornumber[]no[r, g, b]; 0..1; defaults to toolbox colour
coalescestringnoMerges consecutive edits with the same key into one undo step, as a slider drag or a typing session is one.
depth8 | 16 | 32no
heightinteger (≥ 1, ≤ 300000)no1 to 300000; pixel counts are rounded
mode"rgb" | "gray" | "grayscale" | "cmyk" | "lab"no
namestringno
resolutioninteger (≥ 1, ≤ 30000)no1 to 30000; ppi
widthinteger (≥ 1, ≤ 300000)no1 to 300000

Call through photo_run

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

The required parameters, with placeholders for their types: not a tested example. Optional: background, backgroundColor, coalesce, depth, height, mode, name, resolution, width. 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": {
    "background": {
      "default": "white",
      "enum": [
        "white",
        "black",
        "backgroundColor",
        "transparent",
        "#rrggbb"
      ],
      "type": "string"
    },
    "backgroundColor": {
      "description": "[r, g, b]; 0..1; defaults to toolbox colour",
      "items": {
        "type": "number"
      },
      "type": "array"
    },
    "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"
    },
    "depth": {
      "default": 8,
      "enum": [
        8,
        16,
        32
      ],
      "type": "integer"
    },
    "height": {
      "default": 1080,
      "description": "1 to 300000; pixel counts are rounded",
      "maximum": 300000,
      "minimum": 1,
      "type": "integer"
    },
    "mode": {
      "default": "rgb",
      "enum": [
        "rgb",
        "gray",
        "grayscale",
        "cmyk",
        "lab"
      ],
      "type": "string"
    },
    "name": {
      "type": "string"
    },
    "resolution": {
      "default": 72,
      "description": "1 to 30000; ppi",
      "maximum": 30000,
      "minimum": 1,
      "type": "integer"
    },
    "width": {
      "default": 1920,
      "description": "1 to 300000",
      "maximum": 300000,
      "minimum": 1,
      "type": "integer"
    }
  },
  "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.