Node / Images Shapes · guide
Bitmap paint order — implementation reference
Current Apexify.js 6.0.0 documentation for Bitmap paint order — implementation reference.
This section documents ImageCreator.drawImageBitmap so you can predict which combinations silently skip steps.
Legend:
- ✓ runs in normal circumstances
- ✗ skipped because the method returns early
- — not applicable for shapes (
sourceisShapeType)
Shape layers (source ∈ ShapeType)
Executed via drawShape:
blendMode,rotation,opacity,blurshadow(heart/star ⇒ shape shadow helper · otherwise rectangularapplyShadow)boxBackground- Optional
borderRadiusclip (rectangle path, notclipPath) filtersONCE (nofilterIntensityscaling,filterOrderignored) →applyContextImageFiltersoverwidth × heightdrawShapefillstrokeviaapplyShapeStrokefollowing vector geometry
Unsupported on shapes: mask, distortion, meshWarp, clipPath, effects, fit/align (no raster sampling).
Bitmap layers (source path / Buffer)
Inside drawImageBitmap:
| Stage | Step |
|---|---|
| Layout | Resolve inherit, width/height, load bitmap |
| Atmosphere | blendMode · rotation |
| Plate | applyShadow (box) · drawBoxBackground |
| Clip | clipPath if ≥ 3 pts, else buildPath using borderRadius + borderPosition · clip() |
| Raster placement | fitInto → dx, dy, dw, dh · opacity · blur filter |
Branching:
A. filters && filterOrder === 'pre'
- Paint cropped bitmap into temp canvas (
dw × dh). - Apply filters (with
filterIntensityscaling). drawImagetemp onto main canvas inside clip.- RETURN → ✗
distortion, ✗meshWarp, ✗maskcomposite path for main branch, ✗filterOrder: 'post'filters, ✗effects, ✗stroke.
B. distortion.type === 'perspective' with 4 points
Runs applyPerspectiveDistortion → RETURN → same ✗ list as A for downstream stages.
C. distortion.type bulge / pinch
Runs applyBulgeDistortion → RETURN → same ✗ list.
D. meshWarp.controlPoints present
Runs applyMeshWarp → RETURN → same ✗ list.
E. Default raster path
mask?applyImageMask:drawImage(respectingsx,sy,sw,shcrop).- Reset
filter/globalAlpha·restoreclip stack frame.
Still outside early returns:
filters&&filterOrder === 'post'→ snapshotsboxImageData, filters (**with **filterIntensity****), clearsbox, redraws — ✓effects→ vignette / flare direct · chromatic aberration / grain via buffers — ✓applyStrokeonbox— ✓
Final restore pops outer save from blendMode.
Cheat sheet table
| Feature combo | Stroke | Post filters | Effects |
|---|---|---|---|
| Default bitmap | ✓ | ✓ | ✓ |
filterOrder: 'pre' | ✗ | ✗ | ✗ |
perspective / bulge / pinch | ✗ | ✗ | ✗ |
meshWarp | ✗ | ✗ | ✗ |
Grouped composite
See Grouped layers: ordering mixes groupTransform shadows/clips, optional pre-filter early exit, transform stack, post-filter estimation rectangle, effects, then stroke on groupBox.