Anionic substitution in perovskites is less investigated than cationic substitution to tune the physical properties, as the specific local arrangement of the anions has a major effect on them. Hence, we are investigating different titanium-based perovskite-type oxynitrides due to their optical bandgaps in the visible light range making them interesting as pigments and photo(electro)catalysts for pollutant degradation and oxygen evolution reaction from aqueous solutions. For perovskite-type oxides there is a linear correlation between lattice strain and resulting bandgap due to the homogeneous anionic sublattice, while the mixed anionic sublattice of respective oxynitrides causes a priori unknown effect on the bandgap. We are proposing to study a series of titanium-based oxynitrides ATi(O,N)3 with varying lattice distortion from A-site cations and/or N content, by a combination of average and local structure analysis and correlate these results with the bandgaps.