Added code to read data and perform scalar to rgb conversion