Node / Images Shapes · guide
Masking, distortion & mesh warp
Current Apexify.js 6.0.0 documentation for Masking, distortion & mesh warp.
These options apply only when source is a bitmap (string / Buffer). Shape layers use drawShape — use clipPath / borderRadius on the layer instead.
Mask compositing — mask
| Field | Role |
|---|---|
source | Secondary image used as mask channel |
mode | alpha (default): mask alpha drives visibility · luminance: brightness drives visibility · inverse: flips the contribution |
The masked bitmap still honours fit / align into the layout box before masking runs.
Distortion — distortion
Implemented today
type | Requirements | Notes |
|---|---|---|
perspective | Exactly four { x, y } corners in points | Maps the fitted quad into those canvas coordinates |
bulge | Optional intensity (default 0.5) | Lens bulge centred on the fitted bitmap |
pinch | Optional intensity | Negative bulge |
Not wired on the bitmap path
The union includes warp, but ImageCreator.drawImageBitmap currently handles perspective, bulge, and pinch only. warp falls through — leave meshWarp for grid deformation instead.
Distortion branches return immediately after drawing — stroke, effects, and filterOrder: 'post' filters do not run afterward for that layer (see Paint order).
Mesh warp — meshWarp
| Field | Default | Role |
|---|---|---|
gridX / gridY | 10 | Warp subdivision grid |
controlPoints | Required for warp | Nested arrays of displaced lattice nodes |
Like distortion, meshWarp ends the bitmap pipeline early — combine stroke/effects only if you redesign ordering or split layers.
Interaction summary
Use either mask or the straight drawImage path — mesh/distortion branches skip masks.
Do not combine meshWarp + distortion expecting automatic chaining — whichever branch triggers first wins (distortion is evaluated before meshWarp).