A direct method for retrieval of the projected potential from a single HREM image of a thin sample is presented. Both out-of-focus and astigmatic images can be restored. The defocus and astigmatism values are first determined from the Fourier transform of the digitised HREM image. Then a filter is applied which reverts the phases of those Fourier components which have been reversed by the Contrast Transfer Function (CTF). The method has been incorporated into the CRISP image processing system. It can be applied on any sample, crystalline or amorphous. From thin crystalline areas the projected symmetry can be determined and a further improvement achieved by imposing the symmetry exactly. This compensates for the effects of crystal tilt. Five HREM images of a thin crystal of K(8-x)Nb(16-x)W(12+x)O80 (x = 1), taken with different defocus and astigmatism values, were processed. Only one, taken near Scherzer defocus, was directly interpretable before image processing. After processing, all images showed the projected potential of the structure. Using data to 2.77 angstroms resolution, all heavy (Nb/W) atom positions were found in every image, within on average 0.15 angstroms of the positions determined by single crystal X-ray diffraction. In the HREM images taken under non-optimum defocus conditions, also the potassium atoms in the tunnels of the structure were found.