Theoretical modeling of changes in the vibronic absorption and fluorescence spectra in the molecules of two dyes of the thiazine series - methylene blue and methylene green - during the transition from an acidic to an alkaline medium has been carried out by the time dependent density functional theory (TDDFT) method. It is shown that the introduction of the NO2 group leads to more resolved vibronic spectra in the case of low pH values and to the opposite effect at high pH values. This effect can be explained by the intramolecular interaction of functional groups that make up the corresponding molecules.