1. For a graylevel image formed of (i) a first matrix pattern which includes some pixels in at least some rows in the image and (ii) a second matrix pattern which includes the remaining pixels, wherein each pixel in the first pattern has a known value associated therewith, and wherein each pixel in the second pattern is uncoded, apparatus for generating a Markov state input for entropy coding of difference values of second pattern pixels, where each difference value has an arithmetic sign associated therewith, wherein the difference value of a second pattern pixel is based on the difference between a graylevel value and a predicted value of said second pattern pixel, and wherein the second pattern pixels become known after entropy coding using said Markov state, the apparatus comprising: means for generating a gradient Markov state value for an uncoded pixel in a row containing at least two first pattern pixels, the gradient state value being determined based on known values of at least one pixel on each side of said uncoded pixel; and means for determining a sign Markov state value for said subject uncoded pixel, based on the arithmetic sign of a difference value corresponding to at least one second pattern pixel previously entropy coded; the Markov state input of the subject uncoded pixel being derived from the gradient Markov state value and the sign Markov state value thereof.