title: Image manipulation with Mathematica
body: <p>I've created this theme after <a href="https://stackoverflow.com/questions/4706668/some-math-and-animation">my previous post</a>. I can't run the following code (written by @belisarius):</p>
  
  <pre><code>a = Image["path/file.png"]
  b = Image@ArrayPad[ImageData@a, {{40, 0}, {40}, {0}}, {1, 1, 1}];
  f[image_, angleMult_] := ImageForwardTransformation[image, (
      fi = ArcTan[Abs[#[[2]]/(#[[1]] - .5)]];
      fi1 = angleMult fi (#[[1]]^2 + #[[2]]^2)/2;
      {(1/2 - Sin[fi1] #[[2]] - Cos[fi1]/2 + 
         Cos[fi1] #[[1]]), -Sin[fi1]/2 + Sin[fi1] #[[1]] + 
        Cos[fi1] #[[2]]}) &amp;]
  t = Table[f[b, x], {x, 0, .2, .02}];
  t1 = Reverse@t;
  Export["anim.gif", Join[t, t1], "DisplayDurations" -&gt; .15];
  Import["anim.gif", "Animation"]
  </code></pre>
  
  <p>Here is a list of errors:</p>
  
  <pre><code>ArrayPad::depth: Padding amount {{40,0},{40},{0}} should specify padding in no more than the number of dimensions in array {{1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,0.996078,0.984314,&lt;&lt;142&gt;&gt;},&lt;&lt;49&gt;&gt;,&lt;&lt;145&gt;&gt;}. &gt;&gt;
  
  Image::imgarray: The specified argument ArrayPad[{{1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,0.996078,0.984314,&lt;&lt;142&gt;&gt;},&lt;&lt;49&gt;&gt;,&lt;&lt;145&gt;&gt;},{{40,0},{40},{0}},{1,1,1}] should be an array of rank 2 or 3 with machine-sized numbers. &gt;&gt;
  
  ImageForwardTransformation::imginv: Expecting an image or graphics instead of Image[ArrayPad[{{1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,0.996078,0.984314,&lt;&lt;142&gt;&gt;},&lt;&lt;49&gt;&gt;,&lt;&lt;145&gt;&gt;},{&lt;&lt;1&gt;&gt;},{1,1,1}]]. &gt;&gt;
  
  General::stop: Further output of ImageForwardTransformation::imginv will be suppressed during this calculation. &gt;&gt;
  
  Rasterize::bigraster: Not enough memory available to rasterize ImageForwardTransformation expression. &gt;&gt;
  
  General::stop: Further output of Rasterize::bigraster will be suppressed during this calculation. &gt;&gt;
  </code></pre>
  
  <p>I'm using Mathematica 8 under Linux.</p>