One byte per pixel, row-major: 0 = transparent (air), non-zero = solid. Distinct from AlphaSource (RGBA-shaped, 4 bytes per pixel) — the mask is what PixelPerfectSprite keeps in memory once the source has been thresholded, so per-pixel checks read one byte instead of indexing into the alpha channel of an RGBA buffer.

interface AlphaMask {
    data: Uint8Array;
    height: number;
    width: number;
}

Properties

Properties

data: Uint8Array

1 byte per pixel. Length = width * height.

height: number
width: number