The discovery of high-temperature superconductivity in bulk La3Ni2O7 under high hydrostatic pressure1–4 and biaxial compression in epitaxial thin films5–8 has generated substantial interest in understanding the interplay between atomic and electronic structure in these compounds. Subtle changes in the nickel–oxygen bonding environment are thought to be key drivers for stabilizing superconductivity, but specific details of which bonds and which modifications are most relevant remain unresolved so far. Although direct, atomic-scale structural characterization under hydrostatic pressure is beyond present experimental capabilities, static stabilization of strained La3Ni2O7 films provides a platform well suited to investigation with new picometre-resolution electron microscopy methods. Here we use multislice electron ptychography (MEP)9,10 to directly measure the atomic-scale structural evolution of La3Ni2O7 thin films across a wide range of biaxial strains tuned by substrate choice. By resolving both the cation and oxygen sublattices, we study the strain-dependent evolution of atomic bonds, providing the opportunity to isolate and disentangle the effects of specific structural motifs for stabilizing superconductivity. We identify the lifting of crystalline symmetry through modification of the nickel–oxygen octahedral distortions under compressive strain as a key structural ingredient for superconductivity and identify in-plane lattice compression as a common attribute between bulk and thin-film superconductivity. Building on the detailed structures obtained by MEP, we introduce a theoretical framework to disentangle coupled structural distortions in corner-sharing octahedra11, which suggest that both known superconducting geometries of La3Ni2O7 (hydrostatic pressure and compressive strain) suppress local t2g orbital mixing in the low-energy Ni bands by raising the octahedral symmetry.