How to create a multiple frame .tif image using Python PIL

前端 未结 2 835
执念已碎
执念已碎 2020-12-11 21:00

How would I go about creating a new image, using python PIL, which has multiple frames in it.

new_Image = Image.new(\"I;16\", (num_pixels,num_rows))

for f         


        
2条回答
  •  时光取名叫无心
    2020-12-11 21:30

    Start with a PIL image of the first frame, then save that and pass the other frame images in a list to the append_images parameter and save them all. It works with webp, gif, and tiff formats, though tiff appears to ignore the duration and loop parameters:

    im1.save(save_to, format="tiff", append_images=[im2], save_all=True, duration=500, loop=0)
    

    See also the documentation.

提交回复
热议问题