We develop a nanosecond grating imaging (NGI) technique to measure in-plane thermal transport properties in bulk and thin-film samples. Based on nanosecond time-domain thermoreflectance (ns-TDTR), NGI incorporates a photomask with periodic metal strips patterned on a transparent dielectric substrate to generate grating images of pump and probe lasers on the sample surface, which induces heat conduction along both cross- and in-plane directions. Analytical and numerical models have been developed to extract thermal conductivities in both bulk and thin-film samples from NGI measurements. This newly developed technique is used to determine thickness-dependent in-plane thermal conductivities (κx) in Cu nano-films, which agree well with the electron thermal conductivity values converted from four-point electrical conductivity measurements using the Wiedemamn–Franz law, as well as previously reported experimental values. The κx measured with NGI in an 8 nm x 8 nm GaAs/AlAs superlattice (SL) is about 10.2 W/m⋅K, larger than the cross-plane thermal conductivity (8.8 W/m⋅K), indicating the anisotropic thermal transport in the SL structure. The uncertainty of the measured κx is about 25% in the Cu film and less than 5% in SL. Sensitivity analysis suggests that, with the careful selection of proper substrate and interface resistance, the uncertainty of κx in Cu nano-films can be as low as 5%, showing the potential of the NGI technique to determine κx in thin films with improved accuracy. By simply installing a photomask into ns-TDTR, NGI provides a convenient, fast, and cost-effective method to measure the in-plane thermal conductivities in a wide range of structures and materials.