Ir para o conteúdo

Image

ImageClipMaker

Bases: BaseClipMaker[ImageAsset]

A clip maker for image assets.

The image clip maker performs these transformations:

  1. Loads raw image data into OpenCV format
  2. Resizes/crops if needed to match video resolution
  3. Creates temporary image file
  4. Constructs MoviePy ImageClip with:
    • Image data from temp file
    • Position from asset params
    • Duration from clip maker config

Examples:

# Create a basic image clip
maker = ImageClipMaker(duration=5.0, video_resolution=(1920, 1080))
clip = maker.make_clip(image_asset)

# Create clip with background resize
image_asset.params.as_background = True
clip = maker.make_clip(image_asset)  # Will resize to match resolution

# Create clip with custom position
image_asset.params.position = AbsolutePosition(x=100, y=50)
clip = maker.make_clip(image_asset)  # Will position at x=100, y=50