1. A method of processing an image, comprising: decomposing the image into a plurality of channels, each being characterized by a different depth-of-field, and storing said decomposed image in a memory; accessing, by a digital image processor, a non-transitory computer readable medium storing an in-focus dictionary defined over a plurality of dictionary atoms, and an out-of-focus dictionary defined over a plurality of sets of dictionary atoms, each set corresponding to a different out-of-focus condition; computing, by said image processor, at least one sparse representation of said decomposed image over said dictionaries, and storing said at least one sparse representation in a memory, wherein said image is divided into a plurality of patches, and wherein said computing is performed by expressing each patch as a combination of atoms of a sub-dictionary of said out-of-focus dictionary; and generating by said image processor a processed image using said sparse representation, and displaying said processed image on a display device.