The maximum-entropy method (MEM) has been applied for the deconvolution of the point-spread function (PSF) of two-dimensional X-ray detectors. The method is robust, model and image independent, and only depends on the correct description of the two-dimensional point-spread function and gain factor of the detector. A significant enhancement of both the spatial resolution and the contrast ratio has been obtained for two phase-contrast images recorded with an ultra-high-resolution X-ray imaging detector. The method has also been applied to a Laue diffraction image of a protein crystal, showing an important improvement in both the peak separation of closely spaced diffraction peaks and the signal-to-noise ratio of medium and weak peaks. The principle of the method is explained and examples of its application are presented.