1. A method for encoding an image block, the image block comprising a set of pixel values, the method comprising: selecting a prediction mode for predicting pixels in the image block based on neighboring pixels, the prediction mode specifying a predicted value of at least one pixel in the image block as a combination of at least two neighboring pixels, the prediction mode further specifying a direction to be used for prediction, each pixel along a single direction being a function of at least one neighboring pixel, and at least two of the pixels along the single direction being different functions of the at least one neighboring pixel.