I got a memory-problem on the Pi, yesterday I tried the following code with the trialversion of Mathematica on my desktop-pc and it was fine, so I know it used around 4Gb of memory there. But today the trial ended and I needed to go back to my Raspberry...and if I evaluate the code here (even with almost human settings(res 50)) I got a out of memory error after a few seconds. The memorysplit is already set to 16, so I have ~950Mb free - but it seems to be by far not enough.
Clear[trueImg];
rot[t_] := 8 Pi (0.5 + 0.5 Tanh[6 (t - 0.5)]);
trueImg[t_][x_, y_] :=
Module[{xt, yt, f}, {xt, yt} = RotationMatrix[rot[t]].{x, y};
yt = -yt;
f = 0.5 + 0.5 Tanh[8 Sin[5 xt] Cos[5 yt]];
(*List@@(ColorData["RedBlueTones"][f])*);
{f, f, f}]
\[Alpha] = 0.01;
res = 50;
photograph[img_, t_] :=
Module[{dims, \[Tau]},
Rasterize[
Image[Table[
img[t + \[Alpha] (x + 2 y)][x, y], {y, -1, 1, 2/res}, {x, -1, 1,
2/res}]], ImageSize -> {1920, 1080}]];
Export[NotebookDirectory[] <> "1080-Matthen-ChessRotate.avi",
ParallelTable[photograph[trueImg, t], {t, -0.3, 1.5, 0.025}]]
So what can I do now to create this animation on the Raspberry? Is therre any way to solve the mem-problem through cloudcomputing for example? Or is there something in the code that can be changed to save a massive amount of ram?