Start · tutorial
How buffers work
Current Apexify.js 6.0.0 documentation for How buffers work.
What createCanvas returns
SOURCEtypescript
typescript
| Field | Meaning |
|---|---|
buffer | Buffer — PNG image bytes. |
canvas | Copy of the config you passed (CanvasConfig) — handy for debugging. |
Chaining operations
Later methods take that buffer (or CanvasResults) and return a new buffer:
SOURCEtypescript
typescript
Why: each step composites on top of the previous image. If you pass an old buffer, you lose newer work.
CanvasResults shorthand
Some APIs accept CanvasResults (object with .buffer) or a raw Buffer:
SOURCEtypescript
typescript
Both styles work — use whichever is clearer.