added processing of rgb data