from PIL import Image
def produceimage(file_in,width,height,file_out):
image = Image.open(file_in)
resized_image = image.resize((width,height),Image.ANTIALIAS)
resized_image.save(file_out)
file_in = r"I:/echart/images/wlt.png"
width = 460
height = 300
file_out = r"I:/echart/images/wlt-1.png"
produceimage(file_in,width,height,file_out)
将图片的大小更改为460*300