1. A method of encoding an image, the method comprising: selecting a binarization table for binarizing a residual value that is obtained by subtracting a prediction value of a current pixel from a pixel value of the current pixel, from a plurality of binarization tables based on the prediction value of the current pixel; binarizing the residual value by using the selected binarization table and generating a binary string; and arithmetic coding the binary string.