A method of encoding an image, comprising: generating a predicted block of a current block, and subtracting the predicted block from the current block to generate a residual block of the current block; generating information for increasing a spatial correlation among residual values included in the residual block based on the predicted block, and transforming the residual block based on the information; and performing discrete cosine transformation on a part of the transformed residual block based on the information; characterised in that: the generating of the information and transforming of the residual block comprises: generating a gradient map of the predicted block which differentiates between pixels thereof as associated with a plane region of the image and pixels thereof as associated with an edge or texture region of the image; selecting residual values on which the DCT is to be performed, from among the residual values of the residual block, based on the gradient map whereby the values of residuals in a region of the residual block corresponding to a region of the gradient map associated with the edge or texture region of the image are selected; and transforming the residual block by shifting the selected residual values. generating a predicted block of a current block, and subtracting the predicted block from the current block to generate a residual block of the current block; generating information for increasing a spatial correlation among residual values included in the residual block based on the predicted block, and transforming the residual block based on the information; and performing discrete cosine transformation on a part of the transformed residual block based on the information; characterised in that: the generating of the information and transforming of the residual block comprises: generating a gradient map of the predicted block which differentiates between pixels thereof as associated with a plane region of the image and pixels thereof as associated with an edge or texture region of the image; selecting residual values on which the DCT is to be performed, from among the residual values of the residual block, based on the gradient map whereby the values of residuals in a region of the residual block corresponding to a region of the gradient map associated with the edge or texture region of the image are selected; and transforming the residual block by shifting the selected residual values. the generating of the information and transforming of the residual block comprises: generating a gradient map of the predicted block which differentiates between pixels thereof as associated with a plane region of the image and pixels thereof as associated with an edge or texture region of the image; selecting residual values on which the DCT is to be performed, from among the residual values of the residual block, based on the gradient map whereby the values of residuals in a region of the residual block corresponding to a region of the gradient map associated with the edge or texture region of the image are selected; and transforming the residual block by shifting the selected residual values. generating a gradient map of the predicted block which differentiates between pixels thereof as associated with a plane region of the image and pixels thereof as associated with an edge or texture region of the image; selecting residual values on which the DCT is to be performed, from among the residual values of the residual block, based on the gradient map whereby the values of residuals in a region of the residual block corresponding to a region of the gradient map associated with the edge or texture region of the image are selected; and transforming the residual block by shifting the selected residual values.