1. A method for image processing, in which the number of bits is fixed in an encoded bit string, wherein a pixel is encoded into the bit string, the method comprising: if a prediction value is not available for the pixel, encoding a quantized pixel value to the bit string, if the prediction value is available for the pixel, determining a difference between the pixel value and the prediction value, which difference is used for selecting a method for encoding among more than two encoding methods to encode said pixel into the bit string, each method for encoding having a certain step size for quantizing a value, and said certain step size being different in each method for encoding, wherein the method further comprising; determining a code word indicating the selected encoding method on the basis of the original and limited number of bits in the pixel in such a way that the code word length does not exceed N−(M−1) where M corresponds to the limited number of bits and N corresponds to the original number of bits; encoding said code word indicating the selected encoding method and the quantizer step size, and the quantized value to the bit string, in which method the bit string has a fixed-length smaller than the length of the originally digitized pixel for each encoded pixels in the image.