A method of replacing a background in an image with a different background, the method comprising: acquiring a first image of the foreground object and the background under a first lighting condition in which the foreground object and the background are illuminated; acquiring a second image of the foreground object and the background under a second lighting condition in which the background is illuminated; computing a mixing function with at least one processor device based on the second image, the mixing function including a value for each pixel of the second image, the value for each pixel being substantially equal to a first value for pixels that correspond to the background, substantially equal to a second value for pixels that correspond to the foreground object, and between the first value and the second value for pixels that correspond to border regions between the foreground object and the background; computing an object image function with the at least one processor device using the first image and the mixing function, the object image function including an image of the foreground object from the first image and having at least part of the background from the first image removed; and generating a new image including the image of the foreground object from the first image and at least portions of the different background by mixing the different background with the object image function, wherein: pixels of the new image that correspond to the background of the second image are substantially unchanged from pixels of the different background, pixels of the new image that correspond to the foreground object of the second image are substantially replaced by pixels that correspond to the foreground object of the first image, and pixels of the new image that correspond to the border regions between the foreground object and the background of the second image are mixed to include contributions from both the foreground object of the first image and the different background. acquiring a first image of the foreground object and the background under a first lighting condition in which the foreground object and the background are illuminated; acquiring a second image of the foreground object and the background under a second lighting condition in which the background is illuminated; computing a mixing function with at least one processor device based on the second image, the mixing function including a value for each pixel of the second image, the value for each pixel being substantially equal to a first value for pixels that correspond to the background, substantially equal to a second value for pixels that correspond to the foreground object, and between the first value and the second value for pixels that correspond to border regions between the foreground object and the background; computing an object image function with the at least one processor device using the first image and the mixing function, the object image function including an image of the foreground object from the first image and having at least part of the background from the first image removed; and generating a new image including the image of the foreground object from the first image and at least portions of the different background by mixing the different background with the object image function, wherein: pixels of the new image that correspond to the background of the second image are substantially unchanged from pixels of the different background, pixels of the new image that correspond to the foreground object of the second image are substantially replaced by pixels that correspond to the foreground object of the first image, and pixels of the new image that correspond to the border regions between the foreground object and the background of the second image are mixed to include contributions from both the foreground object of the first image and the different background. pixels of the new image that correspond to the background of the second image are substantially unchanged from pixels of the different background, pixels of the new image that correspond to the foreground object of the second image are substantially replaced by pixels that correspond to the foreground object of the first image, and pixels of the new image that correspond to the border regions between the foreground object and the background of the second image are mixed to include contributions from both the foreground object of the first image and the different background.