replace the materials in the base image with those in the reference image without changing the geometry