AntOS Library — image (reference)

The image library'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 — image produces and consumes pixels; putting them on screen is the compositor's / sprite's job. This is deliberately a data library, adjacent to data, 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 behind to_array/from_array without touching the encoders.
  • Screen capture folds in here — a screenshot is just "PNG-encode the framebuffer," so image.screenshot() (async framebuffer → PNG, from the former sys_screenshot) lives with the codec rather than as its own library. The save folder is the shared screenshot.dir setting (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

Important: The Ant64 family of home computers are at early design/prototype stage, everything you see here is subject to change.