1. An image processing method for compressing image data by combining spatial frequency conversion, quantization, and entropy coding, the image processing method comprising: dividing the image data into pixel blocks; performing the spatial frequency conversion on image data for each of the pixel blocks obtained from dividing the image data; generating quantized data for each of the pixel blocks after performing the spatial frequency conversion; generating code data by performing the entropy coding for each of a plurality of change candidate values comprising: (a) a value of the quantized data on an element of interest in a pixel block after performing the spatial frequency conversion and (b) peripheral values to the value of the quantized data on an element of interest within a predetermined range; and selecting one of the plurality of change candidate values as a change value of the quantized data on the element of interest, wherein selecting the change value is based on a size of the code data of each of the plurality of change candidate values, and wherein the image processing method further comprises setting the code data corresponding to the selected change value as the code data on the element of interest, wherein the image processing method further comprises selecting a change amount between the value of the quantized data on an element immediately after the element of interest and each of the plurality of change candidate values.