Abstract: An original image is scanned for respective pixels to determine attributes indicating features for respective pixels of the scanned document. Pixel values included in an M×M area (where M is a natural number) including a pixel of interest are weighted, the pixel value of the pixel of interest is changed based on the weighted pixel values, and smoothing processing is applied to pixels included in that area. Upon applying the smoothing processing, a size of a filtering area used for the smoothing processing is reduced to a size of an N×N area (where N is a natural number, with M>N) including the pixel of interest according to the determined attributes.