After three days of experimentation & testing I have a working WriteRGB16 code that converts
24bit rgb888 to 16bit rgb555 or '5 bits per pixel". Orininal 24bit on left, new 16bit on the right.
There is only a slight perceived difference between them. The original is slightly darker overall.
I could use post processing to darken each pixel or simply leave it the way it is. It's working!
I had to tweak the conversion formula several times in different masking configurations to get
the correct color fidelity. It seems that different bit masking yields different results. So there is
still room to tweak it a little more if needed. Here's the working code if anyone is interested...
Only the working code is good. Everything behind '//' slashes is just old experimental code.
/* Collect 24bit pixel elements */
red = (buf2[x*3]);
green = (buf2[(x*3)+1]);
blue = (buf2[(x*3)+2]);
//linebuf[x*2] = ((green & 0xF8) << 2) | ((blue & 0xF8) >> 3); //Causes light blue -> pink.
//linebuf[(x*2)+1] = ((red & 0xF8) >> 1) | (green >> 6);
//Working code. Good quality images. Blues still not dark enough.
linebuf[x*2] = ((green & 0xF8) << 2) | ((blue & 0xF8) >> 3); // Take remaining 3 Bits of G component and 5 bits of Blue component E3 rgb555
linebuf[(x*2)+1] = ((red & 0xF8) >> 1) | ((green & 0xC0) >> 6); // Take 5 bits of Red component and 2 bits of G component 3C rgb555
//linebuf[x*2] = ((green & 0x38) << 2) | (blue >> 3);
//linebuf[(x*2)+1] = ((red & 0xF8) >> 1) | ((green & 0xC0) >> 6);
//rgb555 = (((blue) >> 3) | (((green) >> 3) << 5) | (((red) >> 3) << 10)); //Blue Washout.
//linebuf[x*2] = (rgb555 & 0xFF);
//linebuf[(x*2)+1] = (rgb555 >>

& 0xFF;