In this paper, we propose a unified approach for document segmentation. Differently of others techniques that segment images without a priori knowledge about the classes to be segmented, this approach carries out a previous learning of what must be segmented. The learning is carried out using only two images, the original one and its ideal segmented version. This stage generates a decision matrix, which is used to extract the similar semantic information in new images. The knowledge acquired in the decision matrix is explored by means of KNN strategy. Performed tests on different types of document images, like signature, postal envelopes and old document databases for instance, showed significant and promising results. It must be emphasized that this learning segmentation approach is completely automatic, does not require heuristics, and may transform the subjective human operator's knowledge into an automatic process and reproduce it.