Calculate drawing grid dimensions for photo-to-canvas transfer
calculate_drawing_gridCompute exact grid columns, rows, per-square pixel size, physical square size on drawing paper or canvas (cm, mm, or in), scaling ratio, usable drawing area, unused/crop margins, and even-row column suggestions.
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": {
"imageWidthPx": "<imageWidthPx>",
"imageHeightPx": "<imageHeightPx>",
"surfaceWidth": "<surfaceWidth>",
"surfaceHeight": "<surfaceHeight>"
},
"name": "calculate_drawing_grid"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| columns | No | Optional number of grid columns across the drawn width (1 to 100). Mutually exclusive with cellSize; defaults to 8 when neither is given. | |
| fitMode | No | 'contain' fits the entire reference image inside the surface with unused margin; 'cover' fills the entire surface and reports image crop margin. Defaults to 'contain'. | contain |
| cellSize | No | Optional desired physical side length of each square on the target surface in surfaceUnit (e.g. 2 for 2 cm squares). Mutually exclusive with columns. | |
| surfaceUnit | No | Physical unit for surfaceWidth, surfaceHeight, and cellSize ('cm', 'mm', or 'in'). Defaults to 'cm'. | cm |
| imageWidthPx | Yes | Reference image width in pixels, e.g. 2400. | |
| surfaceWidth | Yes | Target drawing paper or canvas width in surfaceUnit, e.g. 29.7 (cm) or 11 (in). | |
| imageHeightPx | Yes | Reference image height in pixels, e.g. 1800. | |
| surfaceHeight | Yes | Target drawing paper or canvas height in surfaceUnit, e.g. 21 (cm) or 14 (in). |