1. A method for processing an input low-resolution (LR) image to an output high-resolution (HR) image, comprising: partitioning the input LR image into patches; determining a local n-ary pattern (LnP) for each patch; enlarging the LR image to produce an enlarged LR image (ELR); applying regressions functions based on the LnP to the ELR image patches to generate the output HR image, wherein the regression functions are learned from pairs of training ELR images and training HR images, wherein the steps are performed in a processor.