ndarray-bitmap-to-rgba
Convenience utility to expand 1-channel bitmap into RGBA pixmap. The default export returns white RGB pixels with the Alpha channel taken from the bitmap.
var expand = //alpha bitmap -> rgba pixelsvar pixmap = //use red for the RGB channelsvar pixmap =
Alternatively, you can expand the bitmap into RGB channels, and use 0xFF for alpha:
var expand = var pixmap = expand//RGB = value in bitmap//A = 0xFF
Assumes Uint8 values.
Usage
rgba = expand.alpha(bitmap, [color])
Takes the bitmap ndarray and expands it to a RGBA pixmap where the alpha channel holds the bitmap.
You can pass color
to specify the R, G, B channels. Defaults to white.
This is also the default export.
rgba = expand.opaque(bitmap)
Takes the bitmap ndarray and expands it to a RGBA pixmap where the RGB channels hold the bitmap, and the alpha channel is filled with 0xff
.
License
MIT, see LICENSE.md for details.