1. A method of encoding an image, comprising: generating a predicted block of a current block that is to be encoded in a second color component image from among two or more color component images contained in a received image, by using an encoded and restored first color component image of the two or more color component images; generating a first residual block by calculating the difference between the predicted block and the current block of the second color component image; predicting neighboring pixels of the current block of the second color component image by using corresponding neighboring pixels of a reference block of the first color component image; generating a predicted residual block by using residual neighboring pixels representing the differences between the predicted neighboring pixels of the current block of the second color component image and the original neighboring pixels of the current block, where the predicted residual block is a predicted block of the first residual block; and generating a second residual block by calculating the difference between the first residual block and the predicted residual block.