img.to.wal {wal} | R Documentation |
Convert image to WAL instance.
Description
Convert an input RGB image to a WAL instance, re-mapping its colors to the WAL palette in the process and generating the mipmaps.
Usage
img.to.wal(in_image, apply_palette = wal::pal_q2(), wal = wal.template())
Arguments
in_image |
numeric matrix with 3 dimensions: widt, height, channels. Values must be in range 0..1. This is the image format returned by |
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 |
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. |
Value
wal instance
Examples
## Not run:
wal = img.to.wal(jpeg::readJPEG("~/mytex.jpg"));
## End(Not run)