now uses RGB length and offset for all bit depths.