Trying to improve a certain algorithm for manipulating certain micrograph images, I would like to experiment with "random" synthetic images as input to the algorithm. The pixel entries would be non-negative integers in [0,255]. I would like to assign a covariance, or perhaps a correlation, gamma, so that the covariance of the set of pairs of values (u,v) of all adjacent pairs of pixels (p,q) is expected to be gamma. Here p and q are either adjacent in the same row, or adjacent in the same column. Apart from that, I would like the distribution of pixel values to be as nearly as possible sampled from some standard distribution (eg one-dimensional uniform or one-dimensional normal).
Is there some standard way of producing synthetic pixel values along these lines? I would be particularly interested if one could generate examples rapidly. An answer for 3x3 image matrices would be helpful.