Optically detected magnetic resonance provides ultrasensitive means to detect and image a small number of electron and nuclear spins, down to the single spin level with nanoscale resolution. Despite the significant recent progress in this field, it has never been combined with the power of pulsed magnetic resonance imaging techniques. Here, we demonstrate how these two methodologies can be integrated using short pulsed magnetic field gradients to spatially encode the sample. This result in what we denote as an "optically detected magnetic resonance imaging" technique. It offers the advantage that the image is acquired in parallel from all parts of the sample, with well-defined three-dimensional point-spread function, and without any loss of spectroscopic information. In addition, this approach may be used in the future for parallel but yet spatially selective efficient addressing and manipulation of the spins in the sample. Such capabilities are of fundamental importance in the field of quantum spin-based devices and sensors.