A digital imaging system comprising: optics, having a physical focus, to direct light from a scene onto a physical focal plane, wherein the light is represented by a four-dimensional light field comprising light traveling along a set of light rays; a microlens array (120,1020) comprising a plurality of microlenses (122, 1022) and disposed to receive light passing through the optics from the scene, including the set of light rays; a photosensor array (130, 1030) having a plurality of photosensors (123, 1023) wherein the photosensor array comprises multiple photosensors for each microlens, and each microlens corresponds to multiple sensor pixels, the photosensor array being disposed to detect the set of light rays passing through the microlens array from the optics, wherein each photosensor detects light traveling along different subsets of the set of light rays, including detecting amounts of the light and directional characteristics of the light for each subset of light rays so as to determine where the subsets of light rays originate from in the scene based on locations of photosensors in the photosensor array; and processing circuitry configured to generate a virtual image of the scene using the detected set of light rays by selectively combining data representing the light rays based on the directional characteristics of the light rays from the different subsets, wherein generating the virtual image includes mapping sensor pixel locations to light rays in four-dimensional space, and wherein the virtual image includes a virtual focus at a virtual focal plane, wherein the virtual focus and the virtual focal plane are different from the physical focus and the physical focal plane, respectively. optics, having a physical focus, to direct light from a scene onto a physical focal plane, wherein the light is represented by a four-dimensional light field comprising light traveling along a set of light rays; a microlens array (120,1020) comprising a plurality of microlenses (122, 1022) and disposed to receive light passing through the optics from the scene, including the set of light rays; a photosensor array (130, 1030) having a plurality of photosensors (123, 1023) wherein the photosensor array comprises multiple photosensors for each microlens, and each microlens corresponds to multiple sensor pixels, the photosensor array being disposed to detect the set of light rays passing through the microlens array from the optics, wherein each photosensor detects light traveling along different subsets of the set of light rays, including detecting amounts of the light and directional characteristics of the light for each subset of light rays so as to determine where the subsets of light rays originate from in the scene based on locations of photosensors in the photosensor array; and processing circuitry configured to generate a virtual image of the scene using the detected set of light rays by selectively combining data representing the light rays based on the directional characteristics of the light rays from the different subsets, wherein generating the virtual image includes mapping sensor pixel locations to light rays in four-dimensional space, and wherein the virtual image includes a virtual focus at a virtual focal plane, wherein the virtual focus and the virtual focal plane are different from the physical focus and the physical focal plane, respectively.