Transform Layer
photopea_transform_layerScale, rotate, or flip image layers in-place to resize and reorient content. Modify layer dimensions, rotation, and mirror effects with precise parameters within Photopea.
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.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| target | Yes | Layer name (string) or index (number) | |
| 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) | |
| rotation | No | Rotation angle in degrees (positive = clockwise, negative = counter-clockwise) | |
| flipH | No | Flip the layer horizontally (mirror left-right) | |
| flipV | No | Flip the layer vertically (mirror top-bottom) |