Background: Delignification pretreatments of biomass and methods to assess their efficacy are crucial for biomass-to-biofuels research and technology. Here, we applied confocal and fluorescence lifetime imaging microscopy (FLIM) using one-and two-photon excitation to map the lignin distribution within bagasse fibers pretreated with acid and alkali. The evaluated spectra and decay times are correlated with previously calculated lignin fractions. We have also investigated the influence of the pretreatment on the lignin distribution in the cell wall by analyzing the changes in the fluorescence characteristics using two-photon excitation. Eucalyptus fibers were also analyzed for comparison. Results: Fluorescence spectra and variations of the decay time correlate well with the delignification yield and the lignin distribution. The decay dependences are considered two-exponential, one with a rapid (tau(1)) and the other with a slow (tau(2)) decay time. The fastest decay is associated to concentrated lignin in the bagasse and has a low sensitivity to the treatment. The fluorescence decay time became longer with the increase of the alkali concentration used in the treatment, which corresponds to lignin emission in a less concentrated environment. In addition, the two-photon fluorescence spectrum is very sensitive to lignin content and accumulation in the cell wall, broadening with the acid pretreatment and narrowing with the alkali one. Heterogeneity of the pretreated cell wall was observed. Conclusions: Our results reveal lignin domains with different concentration levels. The acid pretreatment caused a disorder in the arrangement of lignin and its accumulation in the external border of the cell wall. The alkali pretreatment efficiently removed lignin from the middle of the bagasse fibers, but was less effective in its removal from their surfaces. Our results evidenced a strong correlation between the decay times of the lignin fluorescence and its distribution within the cell wall. A new variety of lignin fluorescence states were accessed by two-photon excitation, which allowed an even broader, but complementary, optical characterization of lignocellulosic materials. These results suggest that the lignin arrangement in untreated bagasse fiber is based on a well-organized nanoenvironment that favors a very low level of interaction between the molecules.