A new method for coding and lossless compression of gray scale images has been proposed. After coding of intensities, a prediction process is performed followed by the mapping of prediction residuals that are split into bit planes to which the compression technique is applied. The planes can be coded as uncompressed or compressed using a variable block- size segmentation and coding. The used coding and compression schemes include minterm coding, coordinate data coding, discrete multiple-valued input binary functions, basic Walsh, triangular, Reed-Muller weights and spectra and the reference row technique. Experimental results show that the described method has comparable compression ratios when compared with other compression techniques.