Sorry for not answering for so long, I was out of state.
Apparently I was misled because you talked about color tables in your recent post...
What I was talking about is that for Index color you can make color table file just by making 16x16 image with each pixel representing the color of your color table. Then by following the described process you can get a color table file.
Color table file is nothing more but 256 byte triples:
R1,G1,B1,R2,B2,G2, .... R256, G256, B256
Make the color table file for source color chart, then make the color table file for target color chart. And then you can turn any image to Index color with source color table and change it's color table to target color table thus effectively changing the colors the way you wanted
That can solve the issue but via Index color mode. But now that you want it as a straight 16-bit image I don't really know how you can do this in a general case. Maybe messing up with icc color profiles would do you good. I tried it long time ago but to no avail:sad: