An image processing apparatus, comprising: means for inputting an original multivalue image to be processed; means for classifying a pixel attribute of the pixels of the original multivalue image into one of a plurality of pixel attribute classes used to segment the original multivalued image into a plurality of layer images comprising a first pixel attribute class representing a first layer image and a third pixel attribute class representing a third layer image; means for generating a fourth layer image comprising a first and third type pixel having a pixel attribute corresponding to one of the first pixel attribute class and the third pixel attribute class generated by said classifying; means for generating a first layer image comprising a plurality of first pixels each having a pixel attribute belonging to the first pixel attribute class, the plurality of first pixels comprising a set of first defined pixels each having a defined value determined based on a pixel value extracted from the original multivalue image and a set of first undefined pixels, the first undefined pixels not having a defined value; and means for generating a third layer image comprising a plurality of third pixels each having a pixel attribute belonging to the third pixel attribute class, the plurality of third pixels comprising a set of third defined pixels each having a defined value determined based on a pixel value extracted from the original multivalue image and a set of third undefined pixels, the third undefined pixels not having a defined value; an undefined pixel value determinator (104, 108) for determining values for each of the first undefined pixels or the third undefined pixels, the undefined pixel value determinator comprising: means for dividing the first or third layer image into blocks having a defined block size; means for determining for each of said blocks whether it contains defined and undefined pixels; and means for obtaining an average pixel value of the defined pixels in each block having defined and undefined pixels and assigning that average value to the undefined pixels in that block; characterised by means for setting an increased block size and means for causing the undefined pixel value determinator to repeat its operation using the increased block size until the defined block size is equal or larger than a reference size. means for inputting an original multivalue image to be processed; means for classifying a pixel attribute of the pixels of the original multivalue image into one of a plurality of pixel attribute classes used to segment the original multivalued image into a plurality of layer images comprising a first pixel attribute class representing a first layer image and a third pixel attribute class representing a third layer image; means for generating a fourth layer image comprising a first and third type pixel having a pixel attribute corresponding to one of the first pixel attribute class and the third pixel attribute class generated by said classifying; means for generating a first layer image comprising a plurality of first pixels each having a pixel attribute belonging to the first pixel attribute class, the plurality of first pixels comprising a set of first defined pixels each having a defined value determined based on a pixel value extracted from the original multivalue image and a set of first undefined pixels, the first undefined pixels not having a defined value; and means for generating a third layer image comprising a plurality of third pixels each having a pixel attribute belonging to the third pixel attribute class, the plurality of third pixels comprising a set of third defined pixels each having a defined value determined based on a pixel value extracted from the original multivalue image and a set of third undefined pixels, the third undefined pixels not having a defined value; an undefined pixel value determinator (104, 108) for determining values for each of the first undefined pixels or the third undefined pixels, the undefined pixel value determinator comprising: means for dividing the first or third layer image into blocks having a defined block size; means for determining for each of said blocks whether it contains defined and undefined pixels; and means for obtaining an average pixel value of the defined pixels in each block having defined and undefined pixels and assigning that average value to the undefined pixels in that block; characterised by means for setting an increased block size and means for causing the undefined pixel value determinator to repeat its operation using the increased block size until the defined block size is equal or larger than a reference size. means for dividing the first or third layer image into blocks having a defined block size; means for determining for each of said blocks whether it contains defined and undefined pixels; and means for obtaining an average pixel value of the defined pixels in each block having defined and undefined pixels and assigning that average value to the undefined pixels in that block; characterised by means for setting an increased block size and means for causing the undefined pixel value determinator to repeat its operation using the increased block size until the defined block size is equal or larger than a reference size.