1. An image compressing method for generating, from a foreground layer including N (wherein N is a natural number) kinds of foreground identifiers for identifying color information of respective pixels of a foreground corresponding to a text and/or a line art included in a color image consisting of a plurality of pixels, M (wherein M is a natural number satisfying M<N) binary images respectively corresponding to specific foreground identifiers and compressing the M binary images, comprising steps of: reducing or retaining n 1 (wherein n 1 is an integer satisfying n 1 ≧0) kinds of foreground identifiers for identifying color information of chromatic colors to m 1 (wherein m 1 is an integer satisfying 0≦m 1 ≦n 1 ); and reducing or retaining n 2 (wherein n 2 is an integer satisfying n 2 ≧0 and N=n 1 +n 2 ) kinds of foreground identifiers for identifying color information of achromatic colors to m 2 (wherein m 2 is an integer satisfying 0≦m 2 ≦n 2 and m 1 +m 2 =M); and further comprising the steps of: generating a foreground mask representing the respective pixels of the foreground on the basis of the color image; generating, on the basis of the generated foreground mask and the color image, a foreground layer in which color information of the respective pixels of the foreground is replaced with the N kinds of foreground identifiers for identifying color information of the foreground and color information of respective pixels of a background is replaced with a background identifier indicating that the pixels correspond to the background; generating a table in which color information of the foreground, a foreground identifier for identifying the color information and a number of pixels having the foreground identifier out of all pixels included in the foreground layer are correlated and stored; determining whether or not a number of kinds of foreground identifiers stored in the generated table is to be reduced to be smaller than N; classifying the color information stored in the table into the color information of the chromatic colors and the color information of the achromatic colors when it is determined that the number of kinds of foreground identifiers is to be reduced; determining, in order to retain or reduce the number n 1 of kinds of foreground identifiers for identifying the color information classified as the chromatic colors and the number n 2 of kinds of foreground identifiers for identifying the color information classified as the achromatic colors, the number m 1 of kinds of foreground identifiers for identifying the color information of the chromatic colors to be attained and the number m 2 of kinds of foreground identifiers for identifying the color information of the achromatic colors to be attained; reducing a number of kinds of foreground identifiers stored in the table to M by retaining or reducing the numbers n 1 and n 2 of kinds of foreground identifiers for identifying the color information of the chromatic colors and the achromatic colors stored in the table to the numbers m 1 and m 2 ; correcting the foreground layer to a foreground layer in which the number of kinds of foreground identifiers included therein has been reduced in accordance with a relationship between the foreground identifiers obtained before reducing the number of kinds thereof and the foreground identifiers attained after reducing the number of kinds thereof; generating, on the basis of the corrected foreground layer, the M binary images each of which is obtained by binarizing a pixel value of one kind of foreground identifier and pixel values of the other kinds of foreground identifiers, correspondingly to the M kinds of foreground identifiers; performing lossless compression on the generated M binary images; generating a background layer on the basis of the foreground layer and the color image; and performing lossy compression on the generated background layer.