Docs Format
Effects
On this page
effects is an array of operations applied, in order, to a layer's own pixels before the layer is composited onto the canvas. Effects work on every layer type, groups included.
"effects": [
{ "type": "fade", "side": "bottom", "length": 120 },
{ "type": "sharpen", "strength": 0.5 }
]| Effect | Fields | Meaning |
|---|---|---|
crop | side (top, bottom, left, right), length (number) | Removes length pixels from that side of the layer's pixels. What remains is drawn at the same anchor point |
fade | side, length | Alpha ramps from opaque to transparent over the last length pixels toward side |
sharpen, detail, edge_enhance, find_edges | strength (number, default 1) | Convolution filters |
blur | radius (number, required) | Softens the layer: its pixels spread about radius pixels in every direction. The layer's room grows by that much so the blur is not cut off |
shadow | x, y, blur, color (all optional) | A soft shadow of the layer's shape under it, shifted by x and y pixels (defaults 0 and 4), softened over blur pixels (default 6) and tinted with color (default #00000080, black at half opacity) |
sideandlengthare required forcropandfade. Missing ones are error 1102.lengthis a number on the matching axis: forleftandrightit is horizontal (so%means percent of canvas width), fortopandbottomvertical.- An unknown effect type or
sideis error 1103 (with a hint listing the valid words); an unknown field in an effect is error 1101. - Effects run before rotation and before
opacity. - On a group, effects are relative to the group's bounds.
- In SVG files and vector PDFs,
cropandfadestay vectors. The convolution filters,blurandshadowhave no vector form: a layer or group with one is embedded as pixels at the export resolution (the export dialog's Resolution,--scaleor"scale"; 2x when not given).
Examples
Fade an image into the card at its bottom edge:
{ "id": "art", "type": "image", "src": "{art}", "box": { "x": 0, "y": 0, "w": 800, "h": 500 },
"effects": [{ "type": "fade", "side": "bottom", "length": 120 }] }
Show only the top 60% of a banner:
"effects": [{ "type": "crop", "side": "bottom", "length": "@banner.box.h * 0.4" }]
A soft drop shadow under a panel, in its color at 35 % opacity:
{ "id": "panel", "type": "rect", "box": { "x": 40, "y": 40, "w": 300, "h": 200 }, "radius": 16, "fill": "#FFFFFF",
"effects": [{ "type": "shadow", "x": 0, "y": 8, "blur": 16, "color": "#00000059" }] }
Blur a background picture:
"effects": [{ "type": "blur", "radius": 6 }]
radius and blur are in canvas pixels, so a render at another --scale looks the same. Effects run in order: a shadow after a blur casts the blurred shape, and a blur after a shadow softens both. On a group the shadow is of everything inside, and the group's bounds grow so the shadow is not cut off.