In atomic force microscopy, a 3-D image of a substrate is obtained. With the total number of samples remains constant, there is a trade-off between the size of the scanned image and the resolution. For the scanning mechanism, the time needed to image an area depends mainly on the number of samples and the size of the image. It is desirable to improve the imaging speed with limited impact to the effective resolution of the portion of the substrate that is of interested. To improve the imaging speed, there are two options: 1) increase the data process rate or 2) reduce the amount of data. One key issue for reducing the amount of data is to maintain acceptable image fidelity. To address this issue, we need to classify the sample area into regions based on importance. For high importance regions, a higher resolution is needed. For regions of less importance, a coarse sample density is employed. In this study, we propose a new adaptive sampling scheme that is leveraged from image compression. By adapting the sampling resolution to the substrate profile, the proposed method can decrease the scanning time by reducing the amount of data while maintaining the desired image fidelity.