A non-transitory computer-readable medium storing computer-readable instructions that are executable by a processor of a data generating apparatus comprising a memory having a work area, the instructions being configured to, when executed by the processor, cause the processor to:
- obtain first image data that represents a target image in accordance with a particular description language, the target image including an image obtained by combining N (“N” is an integer equal to or more than 2) first-layer objects in a first combining sequence, the N first-layer objects including a combined image obtained by combining M (“M” is an integer equal to or more than 2) second-layer objects in a second combining sequence, at least one of combining the M second-layer objects and combining the combined object with the other first-layer objects including a color mixing process;
- perform, using the work area, a generation process to generate second image data that represents the target image based on the obtained first image data, the second image data being bitmap data including a plurality of pieces of pixel data, the generation process comprising:
- a first process comprising:
- analyzing the first image data to generate n (“n” is an integer equal to or more than 1 and less than N) pieces of first-layer object data, the n pieces of first-layer object data representing n first-layer objects that have respective earlier orders than the combined object in the first combining sequence, among the N first-layer objects;
- and
- storing the generated n pieces of first-layer object data into the work area;
- a second process comprising:
- after completion of the first process, analyzing the first image data to generate M pieces of second-layer object data representing the M second-layer objects;
- and
- storing the generated M pieces of second-layer object data into the work area;
- a third process to generate, using the n pieces of first-layer object data, first bitmap data representing an image obtained by combining the n first-layer objects;
- a fourth process to generate, using the M pieces of second-layer object data, second bitmap data representing an image obtained by combining the M second-layer objects;
- and
- a fifth process to generate the second image data using the first bitmap data and the second bitmap data;
- determine whether a free space in the work area is less than a first reference value, during the second process;
- in a first case of determining that the free space in the work area is less than the first reference value during the second process, perform:
- interrupting the second process, and performing the third process;
- after completion of the third process, releasing a storage area for the n pieces of first-layer object data in the work area;
- and
- after the storage area for the n pieces of first-layer object data is released, completing the second process;
- and
- in a second case of not determining that the free space in the work area is less than the first reference value during the second process, perform the third process after completing the second process.