---
title: "file.render: Render View — Photo kit command — Kition"
description: "Draws an explicit view of the image as a PNG, without the editor's state: the composite, or only the given layers (even hidden), framed to a region; answers how its pixels map to image coordinates and what it drew. Changes nothing."
canonical: "https://developer.kition.ai/docs/kits/photo/commands/file.render"
---

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

# file.render

**Render View.** Draws an explicit view of the image as a PNG, without the editor's state: the composite, or only the given layers (even hidden), framed to a region; answers how its pixels map to image coordinates and what it drew. Changes nothing.

- Kit: Photo 0.1.0 (PSD, PSB, or .kphoto); reference: [Photo kit commands](https://developer.kition.ai/docs/kits/photo.md)
- Changes the document: no

## Parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `background` | `"transparent" \| "white" \| "#rrggbb"` | no |  |
| `coalesce` | `string` | no | Merges consecutive edits with the same key into one undo step, as a slider drag or a typing session is one. |
| `maxSize` | `integer` | no | 1 to 4096 |
| `scale` | `integer` | no | 0 to 2 |
| `target` | `object` | no | The view: `layer` (an id, or "#n", the n-th of the top level from the top), `layers` (ids), or `objectId` (a layer id) to draw only those layers; `region` [x, y, width, height] in image pixels to frame it. |

## Call through photo_run

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

The required parameters, with placeholders for their types: not a tested example. Optional: `background`, `coalesce`, `maxSize`, `scale`, `target`. photo_run answers the step’s result in `completed[i].result`.

## Result

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `background` | `string` | no |  |
| `drawn` | `any` | no |  |
| `height` | `integer` | no |  |
| `mapping` | `string` | no |  |
| `png` | `string` | no |  |
| `region` | `integer[]` | no |  |
| `scale` | `number[]` | no |  |
| `width` | `integer` | no |  |

```json
{
  "additionalProperties": true,
  "properties": {
    "background": {
      "type": "string"
    },
    "drawn": {},
    "height": {
      "type": "integer"
    },
    "mapping": {
      "type": "string"
    },
    "png": {
      "type": "string"
    },
    "region": {
      "items": {
        "type": "integer"
      },
      "type": "array"
    },
    "scale": {
      "items": {
        "type": "number"
      },
      "type": "array"
    },
    "width": {
      "type": "integer"
    }
  },
  "type": "object"
}
```

## Parameter schema

```json
{
  "additionalProperties": false,
  "properties": {
    "background": {
      "default": "transparent",
      "enum": [
        "transparent",
        "white",
        "#rrggbb"
      ],
      "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"
    },
    "maxSize": {
      "default": 1024,
      "description": "1 to 4096",
      "type": "integer"
    },
    "scale": {
      "default": 1,
      "description": "0 to 2",
      "type": "integer"
    },
    "target": {
      "additionalProperties": false,
      "description": "The view: `layer` (an id, or \"#n\", the n-th of the top level from the top), `layers` (ids), or `objectId` (a layer id) to draw only those layers; `region` [x, y, width, height] in image pixels to frame it.",
      "properties": {
        "layer": {
          "description": "One layer, by id or \"#n\".",
          "oneOf": [
            {
              "type": "integer"
            },
            {
              "type": "string"
            }
          ],
          "x-khp-name": "name",
          "x-khp-role": "object",
          "x-khp-types": [
            "Layer"
          ]
        },
        "layers": {
          "description": "Layers, by id.",
          "items": {
            "oneOf": [
              {
                "type": "integer"
              },
              {
                "type": "string"
              }
            ]
          },
          "type": "array",
          "x-khp-name": "name",
          "x-khp-role": "object",
          "x-khp-types": [
            "Layer"
          ]
        },
        "objectId": {
          "description": "A layer's id.",
          "oneOf": [
            {
              "type": "integer"
            },
            {
              "type": "string"
            }
          ],
          "x-khp-name": "name",
          "x-khp-role": "object",
          "x-khp-types": [
            "Layer"
          ]
        },
        "region": {
          "description": "[x, y, width, height] in image pixels.",
          "items": {
            "type": "number"
          },
          "type": "array"
        }
      },
      "type": "object"
    }
  },
  "returns": "{png, width, height, scale, region, mapping, drawn}",
  "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).
