when generating an intermediate image, which is an image in the middle of changing from one to the other of two pseudo three-dimensional images generated by ray casting a three-dimensional image under two different opacity level setting conditions, determining an opacity level setting condition by determining an opacity level to be allocated according to each pixel value such that a variation in the opacity level for a change in a changing phase of the intermediate image become smaller as the changing phase approaches closer to a pseudo three-dimensional image generated under either one of the two different opacity level setting conditions in which a smaller value is allocated as the opacity level to be allocated according to each pixel value, and generating an intermediate image which appears to change substantially linearly with a linear change in the changing phase by ray casting the three-dimensional image under the determined opacity level setting condition.