The measured spatial coherence characteristics of the illumination used in a diffractive imaging experiment are incorporated in an algorithm that reconstructs the complex transmission function of an object from experimental x-ray diffraction data using 1.4 keV x rays. Conventional coherent diffractive imaging, which assumes full spatial coherence, is a limiting case of our approach. Even in cases in which the deviation from full spatial coherence is small, we demonstrate a significant improvement in the quality of wave field reconstructions. Our formulation is applicable to x-ray and electron diffraction imaging techniques provided that the spatial coherence properties of the illumination are known or can be measured.