Image Coding
The various pixels in an image may be considered to be symbols produced by a discrete information source with the gray levels as the states.
If the successive pixels are independent, then
where pi is the probability of the ith gray level and M = 2n.
While Hmax = n bits, the actual entropy of a real image encountered in practice is considerably lesser as the pixels are not independent.
Due to this reason, one must consider sequences of pixels to estimate the true entropy.