How do I make the animation of the image movement smooth? #3638
Replies: 2 comments 1 reply
-
I tested your code and can confirm that it is a bit rough when rendering in low-quality, but it gets better if you render at high-quality. And the probable reason: this is caused by numerical inaccuracies - you are trying to move the image a very short distance, i.e. not many pixels, but a movement by a fraction of a pixel cannot be rendered correctly. In low-quality the rendered video has only 854x480 pixels resolution. Just looking at the shifting and ignoring the scaling this means that you are moving in total 120 pixels over the time of 30 seconds or 4 pixels per second, about one pixel every fourth rendered frame. Everything is also emphasized by the smooth animation curve, which starts at zero velocity, accelerates and then decelerates again. So in the beginning there is even less then a 4 pixel per second movement. |
Beta Was this translation helpful? Give feedback.
-
Manim has to scale the pixel matrix of your image to match the pixel matrix in the output frame for the video. It can do so using different scaling algorithms - however, repeated scaling of a pixel-based object will deteriorate the quality with every rescaling... |
Beta Was this translation helpful? Give feedback.
-
If I add some image and try to move it (or alternatively move the camera) my animation looks pretty smooth with a small run_time. If I set the run_time for example to 30 seconds, the movement looks jerky and strange (borders are twitching etc.). Is there any way in manim to ensure that the picture moves smoothly for long run_time?
Sample code:
Beta Was this translation helpful? Give feedback.
All reactions