1. An image processing apparatus comprising: a separating unit that separates image data into foreground image data, background image data, and mask image data, the foreground image data including color information of a first area of the image data where a text or a line image is included, the background image data including an image of a second area of the image data where a picture is included, and the mask image data including shape information of the text or the line image; a resolution converting unit that converts the foreground image data into low-resolution foreground image data; a dividing unit that divides the low-resolution foreground image data into a plurality of square blocks composed of a plurality of pixels; an averaging unit that calculates an average pixel value of the pixels included in each of the square blocks, and changes pixel values of the pixels in the square blocks to the average pixel value of that square block thereby obtaining averaged foreground image data of the square blocks; a compressing unit that performs a compression process on the averaged foreground image data of the square blocks thereby obtaining compressed foreground image data of the square blocks; and a merging unit that merges the compressed foreground image data of all the square blocks with the background image data, and the mask image data thereby obtaining compressed image data.