Create a sprite with the specified size, palette data and pixel data, identified by the specified message code (the identifier used on the Lua side to label this sprite)
width(Uint16), height(Uint16), bpp(Uint8), numColors(Uint8), palette (Uint8 r, Uint8 g, Uint8 b)*numColors, data (length: width x height bytes content: palette index)
Create a TxSprite from any image bytes that can be decoded by img.decode()
If it's an indexed image, quantize down to 14 colors if larger
(plus black, white as palette entries 0 and 1.)
If it's an RGB image, also quantize to 14 colors (then prepend black and white)
Scale to 640x400 preserving aspect ratio for 1- or 2-bit images
Scale to ~128k pixels preserving aspect ratio for 4-bit images
TODO improve quantization - quality, speed
If quantizing, since neuralNet seems to give the black in entry 0 and white in the last entry
We just leave 0 (black) and swap palette entries 1 and 15 (and remap those pixels)
Create a TxSprite from an indexed PNG
Sprites should be PNGs with palettes of up to 2, 4, or 16 colors (1-, 2-, or 4-bit indexed palettes)
Alpha channel (4th-RGBA), if present, is dropped before sending to Frame (RGB only, but color 0 is VOID)
Scale to 640x400 if larger, preserving aspect ratio