A system and method for acquiring images containing spatial and spectral information of an object include acquiring defocused images using an optical system based on extended depth of field. The optical system further includes a filter array comprising an array of at least six different sub-filters that are arranged such that any group of four immediately adjacent sub-filters includes at least one red sub-filter, at least one green sub-filter and at least one blue sub-filter. The filter array is located at the aperture stop of the optical system. A coded mask is located at the focal plane of the optical system, and an imager is located beyond the focal plane such that images acquired by the imager are defocused. The images are refocused, and spectral and spatial information is restored by designated software.