gradient and range map update