Wrote function to convert 24 bit rgb to 16 bit rgb