Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

Pillow (PIL): Get image size (width, height) with size, width, height

from PIL import Image

im = Image.open('data/src/lena.jpg')

print(im.size)
print(type(im.size))
# (400, 225)
# <class 'tuple'>

w, h = im.size
print('width: ', w)
print('height:', h)
# width:  400
# height: 225
Source by note.nkmk.me #
 
PREVIOUS NEXT
Tagged: #Pillow #Get #image #size #height
ADD COMMENT
Topic
Name
8+7 =