IMAGING with hard X-rays is an important diagnostic tool in medicine, biology and materials science. Contact radiography and tomography using hard X-rays provide information on internal structures that cannot be obtained using other non-destructive methods. The image contrast results from variations in the X-ray absorption arising from density differences and variations in composition and thickness of the object. But although X-rays penetrate deeply into carbon-based compounds, such as soft biological tissue, polymers and carbon-fibre composites, there is little absorption and therefore poor image contrast. Here we describe a method for enhancing the contrast in hard X-ray images of weakly absorbing materials by resolving phase variations across the X-ray beam1-4. The phase gradients are detected using diffraction from perfect silicon crystals. The diffraction properties of the crystal determine the ultimate spatial resolution in the image; we can readily obtain a resolution of a fraction of a millimetre. Our method shows dramatic contrast enhancement for weakly absorbing biological and inorganic materials, compared with conventional radiography using the same X-ray energy. We present both bright-field and dark-field phase-contrast images, and show evidence of contrast reversal. The method should have the clinical advantage of good contrast for low absorbed X-ray dose.