Lattice QCD calculations of two-nucleon systems are used to isolate the short-distance two-body electromagnetic contributions to the radiative capture process np→dγ, and the photo-disintegration processes γ^{(*)}d→np. In nuclear potential models, such contributions are described by phenomenological meson-exchange currents, while in the present work, they are determined directly from the quark and gluon interactions of QCD. Calculations of neutron-proton energy levels in multiple background magnetic fields are performed at two values of the quark masses, corresponding to pion masses of m_{π}~450 and 806 MeV, and are combined with pionless nuclear effective field theory to determine the amplitudes for these low-energy inelastic processes. At m_{π}~806 MeV, using only lattice QCD inputs, a cross section σ^{806 MeV}~17 mb is found at an incident neutron speed of v=2,200 m/s. Extrapolating the short-distance contribution to the physical pion mass and combining the result with phenomenological scattering information and one-body couplings, a cross section of σ^{lqcd}(np→dγ)=334.9(+5.2-5.4) mb is obtained at the same incident neutron speed, consistent with the experimental value of σ^{expt}(np→dγ)=334.2(0.5) mb.