Bandgaps and defect-state energies are key electrical characteristics of semiconductor materials and devices, thereby necessitating nanoscale analysis with a heightened detection threshold. An example of such a device is an InGaN-based light-emitting diode (LED), which is used to create fine pixels in augmented-reality micro-LED glasses. This process requires an in-depth understanding of the spatial variations of the bandgap and its defect states in the implanted area, especially for small-sized pixelation requiring electroluminescence. In this study, we developed a new algorithm to achieve two-dimensional mappings of bandgaps and defect-state energies in pixelated InGaN micro-LEDs, using automated electron energy-loss spectroscopy integrated with scanning transmission electron microscopy. The algorithm replaces conventional background subtraction-based methods with a linear fitting approach, enabling enhanced accuracy and efficiency. This novel method offers several advantages, including the independent calculation of the defect energy (