๋ฐ์ํ
https://note.nkmk.me/en/python-opencv-pillow-image-size/
Get image size (width, height) with Python, OpenCV, Pillow (PIL) | note.nkmk.me
This article describes how to get the image size (width, height) in Python with OpenCV and Pillow (PIL).The image size can be obtained as a tuple with the attribute shape of ndarray in OpenCV and the attribute size of PIL.Image in Pillow (PIL). Note that t
note.nkmk.me
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
๋ฐ์ํ
'Python > Basic' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
[Python] curve fitting (1) | 2022.09.30 |
---|---|
[Python] PDF ๊ด๋ จ ํจํค์ง ์ ๋ฆฌ (1) | 2022.08.05 |
[Python] ํ์ผ ๊ด๋ จ (0) | 2022.07.19 |
[Python] Excel, Word ๋ค๋ฃจ๊ธฐ (0) | 2021.07.26 |
[Python] XlsxWriter - Excel ๋ค๋ฃจ๊ธฐ (0) | 2021.07.26 |