RAW IMAGE
RAW IMAGE CREATE creates pixel-level images programmatically. Draw pixels directly by coordinate. No canvas, no browser required — runs entirely server-side.
| Verb | Description |
|---|---|
RAW IMAGE CREATE w BY h OPEN NEST ... CLOSE NEST SET ?img | Create an image of width × height pixels. Body contains PIXEL operations. |
PIXEL x y AS "r,g,b" | Set pixel at (x, y) to RGB colour |
PIXEL x y AS "r,g,b,a" | Set pixel with alpha (0–255) |
Basic usage
RAW IMAGE CREATE 100 BY 100
OPEN NEST
PIXEL 50 50 AS "255,0,0"
CLOSE NEST
SET ?img
AFTER EMIT ?img
Try it ›
Gradient — draw multiple pixels
RAW IMAGE CREATE 256 BY 1
OPEN NEST
CALCULATE "0" SET ?x
WHILE ?x IS LESS THAN 256
OPEN NEST
PIXEL ?x 0 AS ?x & ",0,0"
AFTER CALCULATE "?x + 1" SET ?x
CLOSE NEST
CLOSE NEST
SET ?img
AFTER SHARE ?img SET ?url
AFTER EMIT ?url
With alpha channel
RAW IMAGE CREATE 50 BY 50
OPEN NEST
PIXEL 25 25 AS "0,0,255,128" (* semi-transparent blue *)
CLOSE NEST
SET ?img
AFTER EMIT ?img