# screenshot

Source: https://docs.lightair.app/developers/remote-api/screenshot

> Gives a PNG picture of the program, or of another scene.

JSON-RPC 2.0 method of Lightair's Remote API (ws://localhost:4455/rpc). Group: Scenes. Script plugins need the `project.write` permission.

Lightair draws the scene asked for and answers once a fresh frame is there, within 3 seconds.

## Parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `scene` | `string` | no | A scene's id or name. Without it, the program. |
| `width` | `number` | no | The picture's width in pixels, 16 to 7680. Default 960. |

## Result

| Name | Type | Required | Description |
|---|---|---|---|
| `mime` | `string` | no | "image/png". |
| `data` | `string` | no | The PNG, base64. |
| `width` | `number` | no | Its width. |
| `height` | `number` | no | Its height. |

## Errors

Not found (-32004) for an unknown scene. Fails (-32000) when no picture comes in time, or the window is closed.

## From an AI agent

The MCP server's `screenshot` reaches this method.

## Example

```json
{ "jsonrpc": "2.0", "id": 1, "method": "screenshot", "params": { "width": 640 } }
```

Result:

```json
{ "mime": "image/png", "data": "iVBORw0KGgo…", "width": 640, "height": 360 }
```

## Related

- [scene.thumbnails](https://docs.lightair.app/developers/remote-api/scene.thumbnails.md)
- [preview.frame](https://docs.lightair.app/developers/remote-api/preview.frame.md)
