1. A computer generated method, comprising: a processor defining a window of one or more consecutive pixel values in a linear array of pixel values of an image, the defining including adding a pixel value in the linear array to the window so long as the pixel value does not deviate from the pixel values that exist within the window to a degree that causes a threshold value to be exceeded, and, wherein the threshold value decreases as T W /D as the size of the window increases, where T W is the threshold for the Wth pixel of a window, D is a dampening factor and W is the size of the window in pixels; encoding the window of pixel values with a value determined from pixel values within the window and the number of pixel values within the window.