Start · tutorial
Your first image
Current Apexify.js 6.0.0 documentation for Your first image.
Goal
Produce first.png on disk using ApexPainter.createCanvas.
Full example
SOURCEtypescript
typescript
What each part does
| Piece | Why |
|---|---|
async function | createCanvas returns a Promise — you await it. |
createCanvas({ … }) | Builds a bitmap with width, height, and background. |
colorBg | Easiest primary fill — any CSS-style color string. |
buffer | Raw PNG bytes — what you save or pass onward. |
fs.writeFileSync | Writes the buffer to a file (Node.js built-in). |
Result
You get an 800×450 image filled with slate #0f172a.
Try changing
width/height— canvas size in pixels.colorBg— try'#ffffff','rgb(255,99,71)','#6366f133'(alpha).