the pixels of an image is scanned from left to right and from the top to bottom. each new pixel is predicted by the avg of the pixel above and one to the left.
why do you want to predict the value of the next pixel?
As pixels represent the color values and that can be anything based on the captured scene so there's no use in predicting from the neighboring pixel until you are going for scene creation using AI.