Fill Placeholder
photopea_fill_placeholderInsert an image into a template placeholder by scaling it to cover or fit, centering it, and masking it to the placeholder shape for photo frames, mockups, and social templates.
Instructions
Put an image into a template's placeholder layer: the image is scaled to cover (or fit inside) the placeholder's bounds, centered on it, placed above it and masked to its shape. Use it for photo frames, device mockups and social post templates; use edit_text to swap the template's text.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| fit | No | 'cover' fills the placeholder and crops overflow, 'contain' fits the whole image inside it | cover |
| mask | No | Mask the image to the placeholder's shape (a layer mask, so layers added later can't break it) | |
| name | No | Display name for the new image layer | |
| source | Yes | URL or absolute local file path of the image | |
| placeholder | Yes | Placeholder layer name (string) or index (number), e.g. a shape or pixel layer marking where the image goes |