hello..

I need help in converting a bitmap image [say 24bpp or 32bpp] to a grayscale 8bpp.
First, I converted it to a grayscale but with the same bpp, so what is left now is to convert it to 8bpp..
I found a way to do that by comparing the pixel’s color of the source[which is the grayscale now] to the 8bpp ColorPalette, and then save that pixel with the nearest color that maps it from the 8bpp palette.

I wonder is there any other way to do that? –more optimized-
As the image I need to convert now is already grayscale; not coloured, so it’s more limited. And it’s R,G,B values are equal.
So, can we know the value in 8bpp that matches the 24 or 32 bit grayscale, without comparing it to the whole palette each time.

Thanksss.. :icon_smile: ..