Creates an instance of TxSprite.
Configuration options for the sprite.
Whether the pixel data is compressed using LZ4.
The height of the sprite in pixels.
The number of colors in the sprite's palette.
The palette data as a flat Uint8Array of RGB values.
The pixel data as a Uint8Array of palette indices.
The width of the sprite in pixels.
The number of bits per pixel, derived from the number of colors.
Packs the sprite data into a compact binary format. The format includes a header, palette data, and packed pixel data. Pixel data can be optionally compressed using LZ4.
A Uint8Array containing the packed sprite data.
Converts the TxSprite to a PNG image as an ArrayBuffer. Intended for debugging and visualization purposes.
The PNG image data as an ArrayBuffer.
StaticfromCreates a TxSprite from an image file, resizing and quantizing it to a maximum of 16 colors.
The ArrayBuffer containing the image data.
The maximum number of pixels allowed in the sprite.
Whether to compress the pixel data using LZ4.
A TxSprite instance.
StaticfromCreates a TxSprite from an indexed PNG image.
The ArrayBuffer containing the PNG image data.
Whether to compress the pixel data using LZ4.
A TxSprite instance.
A sprite message containing image data with a custom palette.