Python使用PIL将png图片转化为jpg图片
pip install Pillow
#PIL将png图片转化为jpg图片语法
from PIL import Imageim1 = Image.open(r'path where the PNG is stored\file name.png')im1.save(r'path where the JPG will be stored\new file name.jpg')
#PIL将png图片转化为jpg图片
from PIL import Imageim1 = Image.open(r'C:\Users\test.png')im1.save(r'C:\Users\test_2.jpg')
参考:python
参考:PIL
参考:How to Convert JPG to PNG using Python