This paper proposes a novel method for image magnification by exploiting the property that the intensity of an image varies along the direction of the gradient very quickly. It aims to maintain sharp edges and clear details. The proposed method first calculates the gradient of the low-resolution image by fitting a surface with quadratic polynomial precision. Then,bicubic interpolation is used to obtain initial gradients of the high-resolution(HR) image. The initial gradients are readjusted to find the constrained gradients of the HR image, according to spatial correlations between gradients within a local window. To generate an HR image with high precision, a linear surface weighted by the projection length in the gradient direction is constructed. Each pixel in the HR image is determined by the linear surface. Experimental results demonstrate that our method visually improves the quality of the magnified image. It particularly avoids making jagged edges and bluring during magnification.