Microscopic imaging in three dimensions enables numerous biological and clinical applications. However, high-resolution optical imaging preserved in a relatively large depth range is hampered by the rapid spread of tightly confined light due to diffraction. Here, we show that a particular disposition of light illumination and collection paths liberates optical imaging from the restrictions imposed by diffraction. This arrangement, realized by metasurfaces, decouples lateral resolution from the depth of focus by establishing a one-to-one correspondence (bijection) along a focal line between the incident and collected light. Implementing this approach in optical coherence tomography, we demonstrate tissue imaging at a wavelength of 1.3 µm with ~3.2 µm lateral resolution, maintained nearly intact over a 1.25 mm depth of focus, with no additional acquisition or computational burden. This method, termed bijective illumination collection imaging, is general and might be adapted across various existing imaging modalities.