import os
from PIL import Image
path = r'E:\xunlian3'
newpath = r'E:\xunlian3'
def image(path):
files = os.listdir(path)
for i in files:
files = os.path.join(path, i)
img = Image.open(files).convert('RGB')
dirpath = newpath
file_name, file_extend = os.path.splitext(i)
dst = os.path.join(os.path.abspath(dirpath), file_name + '.jpg')
img.save(dst)
image(path)
32为png图转24位jpg图
最新推荐文章于 2023-07-12 16:19:42 发布