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

How to resize ImageClip? #1004

Closed
NewWheat opened this issue Sep 4, 2019 · 1 comment
Closed

How to resize ImageClip? #1004

NewWheat opened this issue Sep 4, 2019 · 1 comment

Comments

@NewWheat
Copy link

NewWheat commented Sep 4, 2019

Previously ImageClip has an attribute of 'resize'. But it doesn't work now, Any one knows how to resize now ?

AttributeError: type object 'ImageClip' has no attribute 'resize'

Thank you.

@PaperBag42
Copy link

The resize function is added as an attribute to VideoClip only when using the moviepy.editor module:

from moviepy.editor import ImageClip

original = ImageClip('img.png')
resized = original.resize(0.5)

However, you can import it directly from the moviepy.video.fx.resize module and use it like so:

from moviepy.video.VideoClip import ImageClip
from moviepy.video.fx.resize import resize

original = ImageClip('img.png')
resized = resize(original, 0.5)

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