Atomic force microscopy (AFM) is one of the most sensitive tools for nanoscale imaging. As such, it is very sensitive to external noise sources that can affect the quality of collected data. The intensity of the disturbance depends on the noise source and the mode of operation. In some cases, the internal noise from commercial AFM controllers can be significant and difficult to remove. Thus, a new method based on spectrum analysis of the scanned images is proposed to reduce harmonic disturbances. The proposal is a post-processing method and can be applied at any time after measurements. This article includes a few methods of harmonic cancellation (e.g., median filtering, wavelet denoising, Savitzky-Golay smoothing) and compares their effectiveness. The proposed method, based on Fourier transform of the scanned images, was more productive than the other methods mentioned before. The presented data were achieved for images of conductive layers taken in a contact AFM mode.