The invention provides a technique for compression processing according to JPEG
2000 or the like in an electronic camera that evaluates the quality of each of
image data groups taken sequentially by an imaging section and records high-rank
image data selectively, and in a related image processing program. The quality
of an image is evaluated based on: an amount of data in a selection region of ROI
coding; an amount of data to a predetermined position of a bit stream; a cutoff
position of a bit stream; a signal level of a high-frequency-range sub-band component;
or an amount of data of a predetermined tile. This quality evaluation makes it
possible to achieve an image selection function that matches the compression processing
of JPEG 2000 or the like very well.