Perfect crystals have recently been used as X-ray wavefront analysers to help produce phase-contrast images of non-periodic objects. Such images are essentially the maps of the phase gradients introduced in a plane X-ray wave upon passage through a weakly absorbing object. We show that the nature of the contrast in the images is determined by the ratio between the local wavefront curvature and the width of the crystal rocking curve. Depending on this ratio being small or large, two quite distinct regimes for image formation can be identified, namely the differential phase-contrast mode and the refractometric mode. We derive simple analytical formulae which can be used for the analysis of X-ray images of phase objects obtained in these two regimes.