A determining unit determines whether a background pixel value of image
data matches a predetermined comparison value. A replacing unit replaces,
when the determining unit determines that the background pixel value does
not match the comparison value, a pixel value of a pixel of the image
data with a replacing value that is obtained by subtracting the pixel
value from a predetermined maximum pixel value. An encoding unit
generates encoded data by encoding the image data in which the pixel
value is replaced with the replacing value by using a predetermined
encoding system.