1. In a computer-implemented image generation system, wherein image elements are provided to a processor for rendering into an image and wherein at least some of the image elements correspond to fragments, a method comprising: for each of a set of fragments, determining characteristics of the fragment, wherein characteristics comprise at least a position of the fragment in a three-dimensional virtual space, at least one color of the fragment, and at least one alpha value for at least one portion of the fragment; for at least two fragments of the set of fragments, determining a depth order in which simulated depth is represented; for each of at least a plurality of pixels, determining a pixel color value by: (a) determining a set of intersecting fragments for that pixel, wherein the intersecting fragments are the fragments from the set of fragments that intersect a view ray for that pixel; (b) assigning an intermediate color to each of the fragments in the set of intersecting fragments, different than the initial color of the fragment for at least one fragment, wherein the assigned intermediate color corresponds to a first compositing of nearby fragments in placement order, wherein the fragments are simulated paint strokes, wherein the placement order corresponds to an order of simulated paint strokes being applied to the image, and wherein assigning the intermediate color to each of the fragments in the set of intersecting fragments comprises: assigning a distinct stroke number to each of the fragments, wherein the stroke number identifies the placement order in which the fragment was created; generating a binary tree having a plurality of nodes, wherein the plurality of nodes comprise a leaf node for each of the fragments and at least one internal node, wherein the at least one internal node comprises a composite of its children nodes, and wherein each of the plurality of nodes comprises a color value and an alpha value; and (c) assigning a color to the pixel that corresponds to a second compositing of the fragments using the intermediate colors assigned to the fragments, wherein the second compositing is done in depth order.