A method of compressing a block of multiple pixels, wherein each pixel of said block of multiple pixels has a pixel property value, said method comprising the steps of: a) losslessly compressing pixel property values of said multiple pixels to get a candidate compressed block; b) comparing a bit length of said candidate compressed block with a target bit length; c) providing a quantization parameter; d) quantizing, if said bit length exceeds said target bit length, said pixel property values of said multiple pixels based on said quantization parameter to get quantized pixel property values of said multiple pixels; e) repeating, if said bit length exceeds said target bit length, said losslessly compressing step a), using said quantized pixel property values, and said steps b) to d) until said bit length is equal to or shorter than said target bit length; and f) generating a compressed representation of said block, wherein said compressed representation comprises the candidate compressed block having a bit length that is equal to or shorter than said target bit length and an identifier of said quantization parameter, wherein said losslessly compressing step a) comprises the steps of: - determining respective predictions of pixel property values of at least a portion of said multiple pixels; - calculating respective prediction errors for said at least a portion of said multiple pixels based on said determined respective predictions; and - entropy encoding said calculated respective prediction errors to get said candidate compressed block. a) losslessly compressing pixel property values of said multiple pixels to get a candidate compressed block; b) comparing a bit length of said candidate compressed block with a target bit length; c) providing a quantization parameter; d) quantizing, if said bit length exceeds said target bit length, said pixel property values of said multiple pixels based on said quantization parameter to get quantized pixel property values of said multiple pixels; e) repeating, if said bit length exceeds said target bit length, said losslessly compressing step a), using said quantized pixel property values, and said steps b) to d) until said bit length is equal to or shorter than said target bit length; and f) generating a compressed representation of said block, wherein said compressed representation comprises the candidate compressed block having a bit length that is equal to or shorter than said target bit length and an identifier of said quantization parameter, wherein said losslessly compressing step a) comprises the steps of: - determining respective predictions of pixel property values of at least a portion of said multiple pixels; - calculating respective prediction errors for said at least a portion of said multiple pixels based on said determined respective predictions; and - entropy encoding said calculated respective prediction errors to get said candidate compressed block. - determining respective predictions of pixel property values of at least a portion of said multiple pixels; - calculating respective prediction errors for said at least a portion of said multiple pixels based on said determined respective predictions; and - entropy encoding said calculated respective prediction errors to get said candidate compressed block.