A near-lossless image compression scheme is presented. It is essential
ly a differential pulse code modulation (DPCM) system with a mechanism
incorporated to minimize the entropy of the quantized prediction erro
r sequence. With a ''near-lossless'' criterion of no more than a d gra
y-level error for each pixel, where d is a small nonnegative integer,
trellises describing all allowable quantized prediction error sequence
s are constructed. A set of ''contexts'' is defined for the conditioni
ng prediction error model and an algorithm that produces minimum entro
py conditioned on the contexts is presented. Finally, experimental res
ults are given.