Speed improvement for RGB processing