moviepy.video.fx.all.resize

moviepy.video.fx.all.resize(clip, new_size=None, height=None, width=None, apply_to_mask=True)[source]

Returns a video clip that is a resized version of the clip.

Parameters:
new_sizetuple or float or function, optional
Can be either
  • (width, height) in pixels or a float representing

  • A scaling factor, like 0.5.

  • A function of time returning one of these.

widthint, optional

Width of the new clip in pixels. The height is then computed so that the width/height ratio is conserved.

heightint, optional

Height of the new clip in pixels. The width is then computed so that the width/height ratio is conserved.

Examples

>>> myClip.resize( (460,720) ) # New resolution: (460,720)
>>> myClip.resize(0.6) # width and height multiplied by 0.6
>>> myClip.resize(width=800) # height computed automatically.
>>> myClip.resize(lambda t : 1+0.02*t) # slow swelling of the clip