SignificanceIn many important processes that control normalCnormalO2 storage in aquifers, oil recovery, and gas exchange in leaves, for instance, flow is controlled by the interaction of immiscible fluids with a rough surface. We use micrometer-resolution X-ray imaging to look inside millimeter-sized porous structures, obtaining millions of measurements of contact angle and interfacial curvature. We quantify the relationship between surface roughness and wettability. Rougher surfaces are associated with lower contact angles and higher interfacial curvatures. We identify a distinct mixed-wet state where two fluid phases remain connected over a wide range of saturation. This state can be designed to improve oil recovery or the performance of fuel cells, catalysts, and other porous materials.