Ashet OS

Ashet Bitmap (.abm)

Ashet Bitmap (.abm) stores 8-bit indexed pixels in a simple uncompressed layout. Color indices always refer to the fixed Ashet OS system palette. All integer fields are little-endian.

The pixel payload is row-major and always contains exactly width * height bytes. If transparency is enabled, every pixel equal to transparency_key is treated as transparent.

During conversion, transparent source pixels (alpha < 0.5) are remapped to one chosen transparency_key index. That key is selected from currently unused color indices among opaque pixels.

§1 Data Encoding

const AbmFlags = packed struct(u16) {
  use_transparency: bool, // bit 0
  _reserved: u15 = 0,
};

const AbmHeader = extern struct {
  magic: u32 = 0x48198b74,
  width: u16,
  height: u16,
  flags: AbmFlags,
  palette_size: u8,     // reserved, must be 0
  transparency_key: u8, // meaningful when flags.use_transparency = true
};

const AbmFile = struct {
  header: AbmHeader,
  pixels: [header.width * header.height]u8,
};

§2 Constraints