This paper describes a method for lossless image compression where relative pixel values of prediction regions in a set of training images are stored as a codebook. In order to achieve decorrelation of the pixels comprising an image, each pixel's prediction neighborhood is assigned to a neighborhood in the codebook, and the difference between the actual pixel value and the predicted value from the codebook is coded using an entropy coder. Using the same codebook, one can achieve perfect reconstruction of the image. The method is tested on several standard images and compared with previously published methods. These experiments demonstrate that the new method is a suitable alternative to existing lossless image compression techniques.