preview
Renders the active Illustrator document or a region as a PNG, optionally comparing it with a reference image to report visual differences and RMSE.
Instructions
Look at the active document: renders a PNG and returns it as an image. One of: artboard (index, default active), refs (items, framed with pad, default 5%), region ([x,y,w,h] from artboard's top-left if given, else the active one's; may lie off it). max_px = longest side (default 1024) or width = exact px. background "white" | "transparent". save_to copies the PNG (with reference: the comparison, and the render as .preview.png). reference: an image (PNG/JPEG) to compare with → ONE image [reference | preview | difference in red] (600 px panels) + rmse (0 = same), content_box in both (shift/scale show an offset or wrong size) and differences: up to 6 regions {rect, kind: shifted (with shift [dx, dy] = preview − reference) | missing | extra | changed, items there}. reference_crop: [x,y,w,h] in image pixels to cut the page out first. One check call: more [artboards] → extra renders (default 500 px); preflight:true, info:true (document_info) add those results.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "preview"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| pad | No | ||
| info | No | ||
| more | No | ||
| refs | No | ||
| width | No | ||
| max_px | No | ||
| region | No | ||
| save_to | No | ||
| artboard | No | ||
| preflight | No | ||
| reference | No | ||
| background | No | ||
| reference_crop | No |