Skip to content
Changelog

screenshot

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

JSON-RPC 2.0project.write

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

Parameters

  • scenestringA scene's id or name. Without it, the program.
  • widthnumberThe picture's width in pixels, 16 to 7680. Default 960.

Result

  • mimestring"image/png".
  • datastringThe PNG, base64.
  • widthnumberIts width.
  • heightnumberIts 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

ws://localhost:4455/rpc
{
"jsonrpc": "2.0",
"id": 1,
"method": "screenshot",
"params": {
"width": 640
}
}

Result

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

scene.thumbnails · preview.frame