1. A method for encoding a residual image using basis functions from an overcomplete library, said method comprising: obtaining the residual image, said residual image having a size and an energy; and decomposing said residual image into a list of one or more atoms, each atom representing a basis function from the overcomplete library, decomposing said residual image comprising: identifying a replacement region in the residual image for representation by an atom, the replacement region being determined by adding an adjacent block to an initial block of the residual image when an energy of the adjacent block exceeds an energy threshold; creating a subset of basis functions from the overcomplete library, each basis function in the subset matching with a shape of the replacement region within a predetermined threshold; identifying an atom within the subset of basis functions using progressive elimination, said atom for representing the replacement region and said atom having parameters; quantizing said atom and modifying the parameters of the atom into a form suited for encoding; encoding said quantized atom, subtracting said atom from the replacement region in the residual image to reduce the energy of the residual image and using a quadtree-based atom coder to reduce the size of the residual image; and when a reduced size of the residual image or a reduced energy of the residual image does not achieve a predetermined criteria; further identifying a replacement region, creating, identifying an atom within the subset of basis functions, quantizing, and encoding.