1. A computer implemented method comprising: receiving reference data comprising a portion of a first background image, the first background image comprising an image of a first background; receiving source data comprising a portion of a source image, the source image comprising an image of the first background and a foreground; calculating, by data processing apparatus, a reference saturation value based on the reference data, the reference saturation value relating to a saturation of the portion of the first background image; calculating, by data processing apparatus, a difference value based on the source data and the reference data, the difference value relating to a difference between the portion of the first background image and the portion of the source image; determining, by data processing apparatus, a source image weighting value for combining the source image with a replacement background image, the replacement background image comprising an image of a replacement background, the source image weighting value based at least in part on a ratio between the difference value and the reference saturation value; and storing the source image weighting value on a computer-readable medium.