An image processing apparatus and an image processing method are disclosed
for generating coded data having a desired data size at a high speed. The
image processing apparatus includes a coding part, two memories, a
setting part and a data size adjustment part. The coding part partitions
a wavelet coefficient of image data into bit-planes and generates coded
data of the image data through entropy coding on the wavelet coefficient
for each of the bit-planes. The data size adjustment part adjusts a size
of the coded data such that the size falls within an acceptable range
including the target size set by the setting part by sequentially
discarding a portion of the coded data in a least significant order based
on the size of the coded data portion corresponding to each of the
bit-planes.