1. A method for encoding image data, the image data being structured in blocks, the method comprising, for each block in at least a portion of the image: predicting pixels of two edges of a block in a first prediction, wherein the first prediction is based on pixels of neighboring blocks from an original image, and wherein estimated predictor pixels are obtained; determining residual data for the estimated predictor pixels; performing quantization and inverse quantization on the determined residual data for the estimated predictor pixels, wherein reconstructed residual data for estimated predictor pixels are obtained; reconstructing predictor pixels, wherein a difference between original pixels and reconstructed residual data for estimated predictor pixels is obtained; predicting remaining pixels of the block from the predicted predictor pixels of at least neighboring blocks, in a second prediction; determining residual data for each predicted pixel resulting from the first or second prediction, the residual data being a difference between the predicted pixel and its corresponding original pixel; and entropy encoding the residual data.