1

I would like smooth animation of a sequence of images, without the controls displayed by ListAnimate. I have a very simple playback function

ShowMovie[movie_, framerate_] := 
 Dynamic[movie[[Clock[{1, Length[movie], 1}, 
     Length[movie]/framerate]]], UpdateInterval -> 0]

But compared to ListAnimate, the animation is very jerky. This is illustrated in the following demonstration, which shows a square varied sinusoidally in luminance at various frequencies. ListAnimate is quite smooth, while ShowMovie is not. This is especially evident at the higher frequencies.

framerate = 60;
Manipulate[(
  frames = If[hz == 0, 1, Ceiling[framerate/hz]];
  contrasts = Sin[2. Pi Range[frames]/frames];
  movie = 
   Image[{{#}}, Magnification -> 128] & /@ (.5 + .5 contrasts);
  method[movie, framerate]
  )
 , {{hz, 1, "Hz"}, {0, 1, 2, 4, 10, 15, 20, 30}, 
  ControlType -> SetterBar}
 , {method, {ShowMovie, ListAnimate}}
 ]

Any suggestions on how to obtain smooth playback?

(This is related to an earlier question of mine but I hope is considered new.)

abwatson
  • 1,919
  • 1
  • 12
  • 19

0 Answers0