Images are to be efficiently and easily encoded while suppressing block
distortion and pseudo-contour generation. A quantization characteristics
determining unit receives pixel values from a pixel value input unit,
measures the length S of the consecutive occurrence of the same pixel
values in connection with a pixel to be encoded and the pixel value
differences D, and determines quantization characteristics n with
reference to the result of sensory evaluation. A quantization/inverse
quantization unit quantizes pixel values to be inputted with the
quantization characteristics n, and further inverse quantizes them to
reduce the number of gray-scale levels. The output pixel values of the
quantization/inverse quantization unit are encoded and outputted by an
entropy encoding unit.