We investigate the basic quantum-mechanical processes behind the nonproportional response of scintillators to incident radiation responsible for reduced resolution. For this purpose, we conduct a comparative first-principles study of quasiparticle spectra on the basis of the G0W0 approximation as well as absorption spectra and excitonic properties by solving the Bethe-Salpeter equation for two important systems, NaI and SrI2. The former is a standard scintillator material with well-documented nonproportionality, while the latter has recently been found to exhibit a very proportional response. We predict band gaps for NaI and SrI2 of 5.5 and 5.2 eV, respectively, in good agreement with experiment. Furthermore, we obtain binding energies for the ground state excitons of 216 meV for NaI and 195-225meV for SrI2. We analyze the degree of exciton anisotropy and spatial extent by means of a coarse-grained electron-hole pair-correlation function. Thereby, it is shown that the excitons in NaI differ strongly from those in SrI2 in terms of structure and symmetry, even if their binding energies are similar. Furthermore, we show that quite unexpectedly the spatial extents of the highly-anisotropic low-energy excitons in SrI2 in fact exceed those in NaI by a factor of two to three in terms of the full width at half maxima of the electron-hole pair-correlation function.