HTML to Image
html-to-imageRenders markup you pass in - not a URL - using the same browser engine, so grid, flexbox, gradients and web fonts all behave normally. The markup is rendered with no base URL, so images must use absolute https addresses or data URIs. Useful for turning email templates, invoices and social cards into pictures without deploying them. Costs 25 credits per call.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"html": "<html>"
},
"name": "html-to-image"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| html | Yes | A full document or a bare fragment. Fragments are wrapped for you. | |
| width | No | Canvas width in CSS pixels; this is the viewport your CSS lays out against. Defaults to 1440. | |
| format | No | png or jpeg. Defaults to png. | png |
| height | No | Canvas height in CSS pixels. Ignored when fullPage is true. Defaults to 900. | |
| quality | No | JPEG quality, 40-100. Ignored for png. Defaults to 85. | |
| fullPage | No | Capture the whole document rather than one canvas-sized frame. Defaults to False. | |
| deviceScaleFactor | No | 1 for standard density, 2 for a Retina render. Defaults to 1. |