- in_image
numeric matrix with 3 dimensions: widt, height, channels. Values must be in range 0..1. This is the image format returned by jpeg::readJPEG
and png::readPNG
. The image can have arbitrary colors, but the colors in the final WAL image will be limited to the palette. Both the width and height must be multiples of 8. Typical idtech1/2 textures use 32, 64, ..., 512. The reason is the mipmaps.
- apply_palette
n x 3 integer matrix, the palette for the WAL image. This is not saved to the wal image, but still required because the colors from the in_image
will be adapted to the palette colors (replaced with the most similar ones). If the palette does not cover the colors in the source image well, the resulting WAL image will look bad (dissimilar to the source image).
- wal
a wal instance. Note that 1 will be substracted from the data when it is written, as indices are stored 0-based in the file.