Considered as topographic reliefs, grayscale images can be decomposed into a number of peaks
that can be stored in the data structure of a tree. This decomposition is called the peak analysis
of grayscale images in this paper. Its mathematical definition and its fast algorithm based on
the watershed transform are both presented. Due to its intuitive definition, there is a wide range
of applications for the peak analysis. One of them is to measure the quantum dots in the AFM
photos. The segmentation result proves to be very accurate and insensitive to noise to some
degree.