I am trying to render an image with some 120,000 Point
s. Technically it's just 10,000 points, plus their reflection, plus 5 rotations of both of those sets, but I'm not sure that's relevant. The code I'm using is something like this:
Graphics[
{
PointSize[1/n],
White,
g = Point /@ Join @@ {points, points.{{1, 0}, {0, -1}}},
Array[Rotate[g, Pi #/3, {0, 0}] &, 6]
},
Background -> Black,
ImageSize -> n*p,
ImageMargins -> n (1 - p)/2
]
where points
contains 10,000 (integer) coordinate pairs.
A reasonably representative set of inputs would be
points = RandomInteger[{0, 10000}, {10000, 2}];
n = 600;
p = 0.8;
In reality, the points are created from a Brownian tree for this challenge over on PPCG.SE.
The problem is, I run out of memory. I don't actually need the resulting vector graphic, but wrapping the above in Rasterize
doesn't help either (so I guess Mathematica does build the full vector graphic representation first anyway).
Is there a better way to rasterise a large number of points into an image? (Other than rounding all coordinates onto an n
-by-n
grid and using that as input to Image
.)