To provide an image processing apparatus and method, a program, and a storage
medium which enables, in the case where encoded data is generated by encoding image
data including mixed multi-level data and bi-level image data and the encoded data
is then decoded, to read bi-level image data from the decoded image in spite of
its low resolution. The multi-level image data and bi-level image data are separated
and hierarchical encoding is performed on the multi-level image data so as to be
decoded with multiple resolutions. Multiple pieces of bi-level data to be superimposed
on the decoded image of multiple resolutions are prepared and encoded. The encoded
bi-level image data is selected for decoding according to the resolution of the
decoded image in the decoding process, and superimposed on the decoded multi-level image.