1. A method for capturing images that include pixels, the method comprising: associating the pixels with tiles responsively to respective locations of the pixels in the images; accepting an input data sequence representing respective current values of the pixels of a currently-captured image frame; within each of at least some of the tiles, comparing the current values with respective reference values of the pixels of a reference frame stored in a frame buffer in order to detect variations between the current and reference values and, when a variation is detected at a given pixel, writing the current value into the frame buffer in place of a corresponding reference value and marking the tile as a changed tile; and writing the current values of the pixels belonging to the changed tile subsequent to the given pixel in the input data sequence into the frame buffer without comparing the current values of the subsequent pixels to the respective reference values, thereby replacing the reference frame with the currently-captured image frame in the frame buffer.