Answers for "get the size of an image + python"

1

python get image size

from PIL import Image

img = Image.open('path/to/image')
width, height = img.size
im.close()
Posted by: Guest on December-20-2020
0

how to find left top width and height on an image using python

import cv2

im = cv2.imread('data/src/lena.jpg')

print(type(im))
# <class 'numpy.ndarray'>

print(im.shape)
print(type(im.shape))
# (225, 400, 3)
# <class 'tuple'>
Posted by: Guest on November-17-2020

Code answers related to "get the size of an image + python"

Python Answers by Framework

Browse Popular Code Answers by Language