Zulko / moviepy

Video editing with Python
https://zulko.github.io/moviepy/
MIT License
12.09k stars 1.51k forks source link

how to write ImageClip? #2059

Closed PetroTruman closed 8 months ago

PetroTruman commented 8 months ago

I created an ImageClip, after transformation, how can I write it into one image file e.g. "image.jpeg" ? I didn't find the answer in the moviepy documentation. I tried write_images_sequence and write_videofile it didn't work out.

mgaitan commented 8 months ago

Try save_frame

from moviepy.editor import ImageClip

# Suppose you've created an ImageClip like this
img_clip = ImageClip('path_to_some_image.jpg')

# Apply your transformations here
# ...

# Save the frame (i.e., the image) to a file
img_clip.save_frame("image.jpeg")
PetroTruman commented 8 months ago

@mgaitan I tried it, it works! Thanks a lot!!!