tricky one...
i know little about images but i know that to find areas of similar colour in a database you find areas of little gradient. The gradient is the rate at which contrast changes between two points or pixels, i.e. if two adjacent pixels have a steep gradient, then it is likely to be a line or an edge of some sort.
if you could find a way of reading an img pixel-by-pixel, then you might be able to measure the contrast and store the difference (greater difference = greater gradient) in an array, and then read the array to find 'flat' areas.
i'm giving myself a headache!!!
adam