This would be incredibly easy in Delphi, because Delphi can do all this for you.
Anyway, I'll still try and give you some help.
In 16-bit data the data is often stored in 5-6-5 format. IE: 5 bit red, 6 bit green, 5 bit blue. Lets assume that's what your data is. (It might not be, but the code is similar even if it's not).
Take one pixel, in a 2-byte variable called Orig.
You want to move it into a 3-byte (really 4, but there you go) variable called NewC, say.
R := (Orig and $1F);
G := (Orig shr 5) and $3F;
B := (Orig shr 11) and $1F;
Now you've got each colour component in it's separate variable, but it's only 5 or 6 bits, not 8 like you want.
R := Trunc(R * 8.25);
G := Trunc(G * 4.05);
B := Trunc(R * 8.25);
Scale 'em up. You scale G by less because it had more bits of data, so needs to be scaled up less.
Finally
NewC := R or (G shl
or (B shl 16);
Haven't tested this code but it's the sort of thing you need.
Questions (probably)..?