python合成APNG动态图片


使用如下命令将当前路径下png格式图片合成为动态图片:

#-*- coding: utf-8 -*-
#!/usr/bin/python3

from apng import APNG
import os

fileList = os.listdir('./')
picList = []
for s in fileList: 
    if os.path.isfile(s) and s.endswith('png'):
        picList.append(s)
picList.sort()
print(picList)
APNG.from_files(picList, delay=3).save("result.png")

你可能感兴趣的:(Python)