canvas_size
Extend the canvas: grow it and reposition the existing content within the larger frame. It never shrinks (use crop for that): REFUSED when either dimension would be smaller than the current one, and when neither dimension actually grows. Choose where the existing content lands with anchor (a 3x3 grid, default 'center') or explicit offset_x / offset_y; give one or the other, not both. fill sets a solid backdrop layer under the WHOLE canvas: white, black, a '#rrggbb' hex color (rendered as luminance on a grayscale photo), or transparent (the default, which adds no backdrop layer at all; see the field description for what that means at export time). IRREVERSIBLE in this session: there is no undo, so make a checkpoint first when in doubt. REFUSES when the photo has a masked filter, or any filter that came with the file, AND the existing content actually moves (offset_x / offset_y not both 0; a top-left anchor never moves anything): extend the canvas before adding masked filters, not after, because a filter's mask does not travel with the layer it confines when the canvas repositions it. An unmasked effect (a vignette and friends) is unaffected. On this server the new canvas must stay within the workspace's pixel limit (less at a higher bit depth).
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": {
"image": "<image>",
"width": "<width>",
"height": "<height>"
},
"name": "canvas_size"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| fill | No | 'white', 'black', a '#rrggbb' hex color, or 'transparent' (default — no fill layer is added at all; see the note on export_photo/flatten below). Any other choice is painted onto a new, full-canvas layer inserted at the BOTTOM of the whole stack — a solid backdrop behind every existing layer, not just the newly added area, so it also shows through any pre-existing transparency in those layers. On a GRAYSCALE image a hex color renders as its LUMINANCE (a weighted gray, not one channel picked out). transparent: genuinely transparent only in a live, layered document — export_photo (unless keep_alpha or a layered psd) and layer op=flatten flatten first, which fills any transparent area with the ambient background color (white, unchanged by this tool) and drops alpha, not with transparency. A non-transparent fill on an INDEXED image is REFUSED outright, before the canvas resizes at all — indexed has no backdrop layer type to add. | transparent |
| image | Yes | Image id, as returned by open_photo. | |
| width | Yes | New canvas width, in pixels. Must be at least the current width, and at least one of width/height must actually be LARGER than the current size (both equal to the current size is refused — there is nothing to extend). | |
| anchor | No | Where the existing content sits within the new, larger canvas — a 3x3 grid. Defaults to 'center' when neither this nor offset_x/offset_y is given. Mutually exclusive with offset_x/offset_y. | |
| height | Yes | New canvas height, in pixels. Must be at least the current height. See width. | |
| offset_x | No | Explicit horizontal offset (document pixels) for the existing content's left edge in the new canvas, instead of an anchor — must be between 0 and (new width - current width). Requires offset_y too; mutually exclusive with anchor. | |
| offset_y | No | Explicit vertical offset for the existing content's top edge, instead of an anchor — must be between 0 and (new height - current height). Requires offset_x too; mutually exclusive with anchor. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| width | No | ||
| height | No | ||
| offset_x | No | ||
| offset_y | No | ||
| mindset_notes | No |