1. A method for encoding a digital image in a block-based manner, in which a spatial prediction for a block is performed to reduce an amount of information to be transmitted, wherein the method comprises: examining pixel values of a neighbouring block of a block to be predicted to determine a classification for the neighbouring block according to the image contents of said neighbouring block; selecting a prediction method for the block to be predicted on the basis of said classification; and forming a spatial prediction for the block to be predicted using the selected prediction method.