The nonplanar shape of a painting as well as practical constraints often result in the painting's surface not being parallel to the plane in that the measurement head of a MA-XRF scanner is being moved. Changing the working distance affects the measurement geometry, so that the sensitivity for the same element may vary throughout the investigated area and induce visible artifacts. These artifacts are especially visible when different scans of the same painting are stitched together. In this article, we present an approach to correct for the variation of the measurement distance. We explored using an intrinsic part of the XRF data set, the Ar signal from the air, to estimate the distance between surface and instrument. The model is developed based on fundamental parameter calculations and a measurement of a NIST 610 standard and is verified on a set of scans of Rembrandt's ‘Portrait of Oopjen Coppit (1611–1689)’.