python pillow image size code example
Example 1: pil get image size
from PIL import Image
im = Image.open('whatever.png')
width, height = im.size
Example 2: python get image size
from PIL import Image
img = Image.open('path/to/image')
width, height = img.size
im.close()
Example 3: python pillow resize image
from PIL import Image
basewidth = 300
img = Image.open('somepic.jpg')
wpercent = (basewidth/float(img.size[0]))
hsize = int((float(img.size[1])*float(wpercent)))
img = img.resize((basewidth,hsize), Image.ANTIALIAS)
img.save('sompic.jpg')