1. A method for operating at least one processor and associated memory to perform image compression of a set of image data comprising: performing a quantization operation, within the processor, on the image data including controlling a compression factor by applying a scaled quantization level obtained by multiplying a first quantization level by a gain factor, with the gain factor being updated as a function of a bit per pixel value of a compressed image; and wherein the update operation comprises at least one iteration for obtaining the gain factor by updating a current gain factor as a function of a previous gain factor used for performing a previous compression step and as a function of a ratio of the bit per pixel value of the compressed image at the previous compression step to a target bit per pixel value.