AntOS Library — image (reference)
The
imagelibrary's design and native core — an image codec. The script-facing API is luau_image.
What it is
Encode and decode images between file formats (PNG, Atari Degas PI1/PC1) and two in-memory pixel forms — a compact RGB888 byte string and a flat 0xRRGGBB integer array for Lua-side pixel work.
Design notes
- Codec, not a display path —
imageproduces and consumes pixels; putting them on screen is the compositor's /sprite's job. This is deliberately a data library, adjacent todata, so it stays usable off-screen (batch conversion, thumbnails, asset baking). - Runs on the CM, where PNG encode/decode can lean on the VideoCore/libpng path; the retro Atari formats (PI1/PC1) are the small custom codecs that make period artwork first-class.
- Two pixel forms, one set of encoders — the string form is what the codecs speak; the integer-array form exists purely so Lua can poke individual pixels. A future
0xAARRGGBB(alpha) form slots in behindto_array/from_arraywithout touching the encoders. - Screen capture folds in here — a screenshot is just "PNG-encode the framebuffer," so
image.screenshot()(async framebuffer → PNG, from the formersys_screenshot) lives with the codec rather than as its own library. The save folder is the sharedscreenshot.dirsetting (os.settings).
Native core — libantos_image
sys_image holds the codecs and the pixel-form conversions — pure byte-in/byte-out C, no Luau. The binding adds buffer ownership and the load/save file wrappers.
Related
- luau_image — the script API · antos_sprite · antos_data · AntOS Libraries hub