  Magnetic imaging with ensembles of nitrogen-vacancy (NV) centres in diamond
is a recently developed technique that allows for quantitative vector field
mapping. Here we uncover a source of artefacts in the measured magnetic field
in situations where the magnetic sample is placed in close proximity (a few
tens of nm) to the NV sensing layer. Using magnetic nanoparticles as a test
sample, we find that the measured field deviates significantly from the
calculated field, in shape, amplitude and even in sign. By modelling the full
measurement process, we show that these discrepancies are caused by the limited
measurement range of NV sensors combined with the finite spatial resolution of
the optical readout. We numerically investigate the role of the stand-off
distance to identify an artefact-free regime, and discuss an application to
ultrathin materials. This work provides a guide to predict and mitigate
proximity-induced artefacts that can arise in NV-based wide-field magnetic
imaging, and also demonstrates that the sensitivity of these artefacts to the
sample can make them a useful tool for magnetic characterisation.
