1. A system comprising: a programmable processor; and a computer-readable medium comprising a computer program product for generating a composite image, the computer program product comprising instructions operable to cause the programmable processor to: provide electronic data representing at least three image layers to be combined in a composite image, at least one of the image layers having two-dimensional content and at least one of the image layers having three-dimensional content, the layers being arranged in a sequence represented by a composition sequence list; group the at least three image layers into at least three metalayers, each of the metalayers including one or more image layers having content having a common dimensionality such that each image layer that is adjacent to an image layer having a common dimensionality is grouped in the same metalayer as that image layer, the metalayers being arranged in a metalayer sequence; and select a metalayer from among the metalayers according to the metalayer sequence and process the image layers in the selected metalayer to generate a raster representation of the image layers in the selected metalayer and composite the raster representation into an image buffer until the raster representation of each of the metalayers has been composited into the image buffer to form a composite image.