We describe a simple technique for simultaneously imaging multiple layers within an object field onto a single camera. The approach uses a binary diffraction grating in which the lines are distorted such that a different level of defocus is associated with each diffraction order. The design of the gratings is discussed, and their ability to image multiple object planes is validated experimentally. Extension of the technique for spherical-aberration correction is described, and it is shown how the gratings can be used as part of a wave-front-sensing system.