High-degree linearity in the magnetic field gradients has been considered essential in order to reconstruct an accurate NMR image from projections. Here, for the first time, the effects of nonlinear gradients on the reconstructed NMR images are analysed in detail. It is found that the gradient nonlinearities cause geometric distortions on the image. The image can be fully recovered from the distortions, provided that the spatial distributions of the field generated from each set of gradient coils are known. Computer programs are used to stimulate an imaging experiment under nonlinear gradients, and demonstrate the techniques of restoring the distorted image. After the restoration, the image gives accurate geometry and intensity information, but, unlike imaging under linear gradients, the spatial resolution is not uniform nor isotropic.