1. A computer implemented method for touching up a source image to produce a target image, comprising: partitioning a source image into non-overlapping tiles of pixels; labeling each tile with a label; inferring a probability distribution of the labels, in which the probability distribution is a conditional random field; determining weights from the conditional random field; and transforming each tile of the source image according to the weights to produce a corresponding tile of the target image, in which the transforming maximizes a conditional likelihood of the target image given the source image, while marginalizing over all possible labelings of the source image, in which the transforming is an affine operator in a gradient domain: h ⁡ ( y i ) = W i ⁡ [ g ⁡ ( x i ) 1 ] + v , ( 3 ) where g(x i ) and h(y i ) are differentials of the tiles of the source image and the target image, respectively, and W e i is a matrix of the weights, and v e accounts for noise.