获取图片大小
import io, urllib from PIL import Image # url = 'https://steamcdn-a.akamaihd.net/steamcommunity/public/images/apps/578080/ecb8776e4e2b3d962a16b58e1172d5c277a52fa0.ico' url = 'https://steamcdn-a.akamaihd.net/steamcommunity/public/images/apps/578080/93d896e7d7a42ae35c1d77239430e1d90bc82cae.jpg' file = urllib.request.urlopen(url) tmpIm = io.BytesIO(file.read()) im = Image.open(tmpIm) print(im.format, im.size, im.mode)