Primal-dual coding photography is a new photographic technique that uses coded illumination and exposure to selectively record user-defined subsets of light paths, generalizing conventional photography. It modulates the contribution of specific light paths using a "probing matrix" of primal codes for illumination and dual codes for exposure over multiple frames. This allows effects like enhancing direct light, capturing indirect light of different ranges, separating light transport effects, and making 3D regions invisible or color-coded in the photo. The technique provides guarantees of optimality and convergence for reconstructing images from the coded photo measurements.