1. A method of encoding an image in an apparatus for 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 in which residual values in a range of the residual value that is determined based on the prediction value of the current pixel correspond to binary strings; binarizing the residual value by using the selected binarization table and generating a binary string; and arithmetic coding the binary string.