The concept of 'bandgap mapping' was proposed originally to map the inhomogeneity of band energy in III-V semiconductors with a spatial resolution of a few nanometres in a scanning transmission electron microscope with the focus beam mode. In this paper, several techniques were developed to demonstrate the possibility to map the distribution of bandgap energies for GaN/AlN quantum-well structures using electron spectroscopy imaging (ESI). The phase correlation function was used to register different energy-loss images among ESI series with an accuracy of 1 pixel. The energy dispersion of ESI series was improved by a fast Fourier transform interpolation method. An iterative multivariable least square algorithm was derived to refine the fitting of the single scattering distribution to an analytic form of the density of states function a(E - Eg)0.5. The inhomogeneity of the band energy of the quantum well can be revealed from the band-energy map. A threshold filter method is applied to estimate the average value and SD of the bandgap energy from barrier and well regions in the energy map. The average bandgap energy of AlN and GaN is determined to be 5.62 ± 0.35 and 3.87 ± 0.36 eV, respectively. The effect of delocalization on the accuracy of band-energy determination is discussed. The 2σEg accuracy of this analysis is comparable to half of the energy resolution of the ESI experiment.