1. An image processing method comprising: a selection step of selecting one of a plurality of compression algorithms; an input step of inputting a code representing an object; a discrimination step of discriminating the type of object represented by the code; a decision step of deciding, in accordance with the object type and the selected compression algorithm, the number of bits per pixel of image data to be converted from the code; a conversion step of converting the code into image data of the decided number of bits; and an encoding step of encoding the converted image data based on the selected compression algorithm; wherein the above steps are performed by a processor.