1. An image processing apparatus for compressing an image, comprising: a compressing section configured to perform operations comprising compressing the image based on N representative colors to generate N-representative-color-based compression data and calculating an indicator for evaluating an image quality of the image compressed based on M representative colors during the compressing the image based on N representative colors, N and M each representing a number of representative colors and satisfying M<N, the compressing the image including dividing the image into a plurality of blocks, extracting representative colors from each of the blocks, and assigning one of the representative colors to each pixel in the blocks; a control section configured to compare the indicator and a predetermined threshold to judge whether a reduction of a number of representative colors of the N-representative-color-based compression data from N colors to M colors causes a deterioration of an image quality or not; and a converting section configured to reduce the number of the representative colors of the N-representative-color-based compression data from N colors to M colors to generate M-representative-color-based compression data in response to judging that the reduction of the number of the representative colors does not cause the deterioration of the image quality.