In [1]:
from PIL import Image

In [2]:
im = Image.open('data/src/lena.jpg')

In [3]:
print(im.size)
print(type(im.size))


(400, 225)
<class 'tuple'>

In [4]:
w, h = im.size
print('width: ', w)
print('height:', h)


width:  400
height: 225

In [5]:
print('width: ', im.width)
print('height:', im.height)


width:  400
height: 225

In [6]:
im_gray = Image.open('data/src/lena.jpg').convert('L')

In [7]:
print(im.size)
print('width: ', im.width)
print('height:', im.height)


(400, 225)
width:  400
height: 225