replace the range with the one from the reference image