Transform Layer
photopea_transform_layerScale, rotate, or flip a layer in-place with destructive pixel modification. Check layer bounds beforehand using get_layers and undo if needed.
Instructions
Scale, rotate, or flip a layer in-place. Modifies the layer's pixel data destructively. Use get_layers to check current layer bounds before transforming, and undo to revert if needed.
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": {
"target": "<target>"
},
"name": "photopea_transform_layer"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| flipH | No | Flip the layer horizontally (mirror left-right) | |
| flipV | No | Flip the layer vertically (mirror top-bottom) | |
| scaleX | No | Horizontal scale factor (1.0 = no change, 0.5 = half size, 2.0 = double size) | |
| scaleY | No | Vertical scale factor (1.0 = no change, 0.5 = half size, 2.0 = double size) | |
| target | Yes | Layer name (string) or index (number) | |
| rotation | No | Rotation angle in degrees (positive = clockwise, negative = counter-clockwise) |