capture the image to a file