from PIL import Image # 打开原始图片 image = Image.open('路由器_1.png') new_width = 45 new_height = 45 resized_image = image.resize((new_width,new_height)) # 保存图片 resized_image.save('路由器_2.png')