1. A method of extracting metadata from a document image of pixels, the pixels having a value representing the intensity and/or color of a picture element, the method comprising: displaying at least part of the image on a display screen for a user; receiving a selection command from a user, the selection command including an indication of a selection point in a metadata element in the image; automatically classifying pixels as foreground pixels based on their values having a foreground property; automatically determining an extraction area within the image in accordance with the selection command by: setting a connection distance; automatically selecting a first foreground pixel based on the selection point; and starting from the first foreground pixel, automatically building up a connected region of foreground pixels by progressively including any foreground pixel that is within the pre-set connection distance apart from the first foreground pixel or any other foreground pixel already included in the connected region until no further foreground pixel is within the pre-set connection distance apart from any foreground pixel already included in the connected region; and extracting the metadata by processing pixels in the extraction area.