Just use it
The RGB565 format is useful for embedded systems, as many LCD displays utilize this format.
canvas to obtain the pixel data and convert it to RGB565.
Some of the code was provided by Bing, powered by GPT, although I made some modifications to ensure it works properly.
The result is in little-endian format.