In this letter, we propose a new algorithm for lossless compression of hyperspectral images. The proposed method searches the previous band for a pixel of equal value to the pixel co-located to the one to be coded. The pixel in the same position as the obtained pixel in the current band is used as the predictor. Lookup tables are used to speed up the search. The algorithm is suitable for compression of hyperspectral image data in the band-interleaved-by-line (BIL) format. The method outperforms other state-of-the-art compression algorithms for the BIL data, at a lower time complexity level. Moreover, its compression ratios for the band sequential format data are within a few percentage points of the current state-of-the-art methods.