Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rotating image animation producing error #130

Closed
ebin123456 opened this issue Feb 19, 2015 · 6 comments
Closed

rotating image animation producing error #130

ebin123456 opened this issue Feb 19, 2015 · 6 comments

Comments

@ebin123456
Copy link

i have code like

import numpy as np
import Image
from scipy import ndimage
import moviepy.editor as mpy

img = Image.open('leo_messi.jpg')
data = np.array(img.getdata(),np.uint8).reshape(img.size[1], img.size[0], 3)
def make_frame(t):
    return ndimage.rotate(data,int(t)*10)


clip = mpy.VideoClip(make_frame, duration=5)
clip.write_videofile("circle.mp4",fps=10)

I am trying to produce an animation that have rotation of input image. its not working

@Zulko
Copy link
Owner

Zulko commented Feb 19, 2015

what's the error ?

@ebin123456
Copy link
Author

Full of noice in output video.
On Feb 19, 2015 6:06 PM, "Zulko" notifications@github.com wrote:

what's the error ?


Reply to this email directly or view it on GitHub
#130 (comment).

@ebin123456
Copy link
Author

Hi
i have fixed issue by passing reshape=False argument

return ndimage.rotate(data,int(t)*10,reshape=False)

@Zulko
Copy link
Owner

Zulko commented Feb 20, 2015

Cool, I was going to suggest that. Just so you know it will soon be possible to rotate a clip like so in moviepy:

newclip = clip.rotate(angle=lambda t: 10*t, *some_parameters)

I use the rotation offered by PIL (or rather pillow) I think it's slightly better than the one in ndimage.

@ebin123456
Copy link
Author

Good work.
Thanks.

@ghost
Copy link

ghost commented Feb 15, 2017

seems issue has been resolved.. closing

@ghost ghost closed this as completed Feb 15, 2017
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants