Repository navigation
Draw Image
Mikkel edited this page May 6, 2026
·
2 revisions
Draws a packed indexed image.
Images use indexed pixel data encoded as Base64.
Pixel format:
- 4 bits per pixel
- 2 pixels packed per byte
- Indexed palette rendering
See:
| Name | Type | Description |
|---|---|---|
| x | int | Top-left X coordinate |
| y | int | Top-left Y coordinate |
| width | int | Image width |
| height | int | Image height |
| data | string | Base64 encoded pixel data |
- Transparent pixels are skipped during rendering
- Images are rendered sequentially like other commands
- Existing pixels may be overwritten
- Rendering outside display bounds may be clipped
{
"cmd": "draw_image",
"args": {
"x": 100,
"y": 0,
"width": 100,
"height": 100,
"data": "BASE64_DATA"
}
}Renderers should:
- Decode Base64 image payloads safely
- Validate image dimensions
- Ignore invalid pixel values where possible
- Skip transparent pixels
- Avoid drawing outside framebuffer bounds