1. A method for predicting an offset factor for a target block of a multi-layer image, wherein said multi-layer image comprises a low-dynamic-range layer and a high-dynamic-range layer and said offset factor is used to predict said high-dynamic-range layer from said low-dynamic-range layer, said method comprising: a) determining a first scaling parameter and a first offset parameter for a first adjacent block, said first adjacent block being adjacent to said target block; b) determining a second scaling parameter and a second offset parameter for a second adjacent block, said second adjacent block being adjacent to said target block; c) fitting a mathematical model to said first scaling parameter, said second scaling parameter, said first offset parameter and said second offset parameter; d) determining a target scaling parameter for said target block; and e) determining a target offset parameter for said target block using said target scaling parameter and said mathematical model.