1. A method for processing image data, comprising: providing input image data; segmenting the input image data to generate: a background layer representing the background attributes of an image; and one or more binary foreground layers, wherein each binary foreground layer comprises one or more pixel clusters representing text pixels of a particular color in the input image data; further segmenting an image data on the background layer to generate: a sub-background layer representing the background attributes of the image data on the background layer; a selector layer for identifying one or more foreground attributes of the image data on the background layer that are not included in the sub-background layer; and a sub-foreground layer representing the foreground attributes of the image data on the background layer; and integrating the sub-background layer, the selector layer, the sub-foreground layer, and the one or more binary foreground layers into a data structure having machine-readable information for storage in a memory device.