moviepy.video.VideoClip.ImageClip#

class moviepy.video.VideoClip.ImageClip(img, is_mask=False, transparent=True, fromalpha=False, duration=None)[source]#

Class for non-moving VideoClips.

A video clip originating from a picture. This clip will simply display the given picture at all times.

Examples

>>> clip = ImageClip("myHouse.jpeg")
>>> clip = ImageClip( someArray ) # a Numpy array represent
Parameters:
  • img – Any picture file (png, tiff, jpeg, etc.) as a string or a path-like object, or any array representing an RGB image (for instance a frame from a VideoClip).

  • is_mask – Set this parameter to True if the clip is a mask.

  • transparent – Set this parameter to True (default) if you want the alpha layer of the picture (if it exists) to be used as a mask.

img#

Array representing the image of the clip.

image_transform(image_func, apply_to=None)[source]#

Image-transformation filter.

Does the same as VideoClip.image_transform, but for ImageClip the transformed clip is computed once and for all at the beginning, and not for each ‘frame’.

time_transform(time_func, apply_to=None, keep_duration=False)[source]#

Time-transformation filter.

Applies a transformation to the clip’s timeline (see Clip.time_transform).

This method does nothing for ImageClips (but it may affect their masks or their audios). The result is still an ImageClip.

transform(func, apply_to=None, keep_duration=True)[source]#

General transformation filter.

Equivalent to VideoClip.transform. The result is no more an ImageClip, it has the class VideoClip (since it may be animated)