1. A method for dynamically refocusing an input image to simulate a focus plane and a depth-of-field of a virtual camera, the method comprising: a computer performing: receiving the input image, wherein the input image includes depth information for pixels in the input image; obtaining parameters that specify the depth-of-field d and the location of the focus plane for the virtual camera; and using the depth information and the parameters for the virtual camera to selectively refocus the input image to produce a refocused image; wherein for each pixel in the input image, producing the refocused image involves: using the depth information and the parameters for the virtual camera to determine a blur radius B for the pixel, and using the blur radius B for the pixel to determine whether the pixel contributes to neighboring pixels in the refocused image.