Add Shape
photopea_add_shapeAdd vector shapes to Photopea documents by creating rectangles or ellipses with precise positioning. Define fill colors, strokes, and bounds to generate scalable, non-destructive layers for graphic design.
Instructions
Add a vector shape layer (rectangle or ellipse) to the active document. The shape layer becomes the active layer. Shapes are non-destructive and can be resized with transform_layer without quality loss.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| type | Yes | Shape type to create | |
| bounds | Yes | Shape bounds | |
| fillColor | No | Color as hex string (e.g. #ff0000) | |
| strokeColor | No | Color as hex string (e.g. #ff0000) | |
| strokeWidth | No | Stroke width in pixels | |
| name | No | Name for the shape layer |