Grayscale sensor data display on RGB565 Color TFT screen

how convert Grayscale sensor data to RGB565?

image to rainbow does this:

Converts an image to an RGB565 rainbow image (16-bits per pixel).
is this ok or want something else?

is this one?src/omv/imlib/rainbow_tab.c?what is the principle?
I use esp32 chip to get grayscale camera data and display on RGB565 Color TFT screen

i was talking about the image class inside openmv. dint know your setup though.
DIdn’t know that you can run openmv on an esp also…
So i cant help…

I think openmv code can convert grayscale sensor data to RGB565 because openmv can display grayscale sensor data on Color TFT screen(RGB565),I want to kown how openmv do it?
I do not run openmv on an esp32 chip!

you must give more info about the libraries, api and coding you use . maybe someone can help you despite that this is an openmv forum…
In addition you can display a grayscale image to a color tft lcd via openmv also…

grayscale sensor data is 8bit, when display on RGB565 Color TFT screen, data should be RGB565 ,so I think
r = GrayValue/256 * 32 = GrayValue/8 = GrayValue >> 3
g = GrayValue/256 * 64 = GrayValue/4 = GrayValue >> 2
b = GrayValue/256 * 32 = GrayValue/8 = GrayValue >> 3
is it ok ?

1 Like

Out default LCD driver does all those for you. I would suggest using it. It does support any resolution display.

1 Like