STM images recorded with piezoelectric drivers show characteristics distortions at the boundaries where the tip motion is reversed. Such artifacts can be eliminated by correcting for aftereffect assuming a logarithmic time-dependence. The amplitudes of such terms and the time elapsed between scan direction reversal and scan recording can be estimated by visual inspection of the corrected scan image on a graphics display and by maximizing picture correlation functions. STM images of well ordered clean single-crystal gold and copper surfaces are satisfactorily restored with this procedure. © 1992.