Python How to find dimensions of the image

0 votes
How to find out the dimensions of the image and convert it into a two-dimensional array?
Jul 11, 2019 in Python by Kunal

1 answer to this question.

+1 vote

You can use the Pillow package here, which is the successor of PIL.

from PIL import Image  # uses pillow 
image_file = "something.jpg"
im =
print im.size # return value is a tuple, ex.: (1200, 800)
answered Jul 11, 2019 by Likith

Related Questions In Python

–1 vote
2 answers

How to find the size of a string in Python?

following way to find length of string  x ...READ MORE

answered Mar 29, 2019 in Python by rajesh
• 1,230 points
0 votes
1 answer

How to find the value of a row in a csv file in python?

If you want to find the value ...READ MORE

answered May 20, 2019 in Python by Sanam
0 votes
1 answer

How to find the value of a row in a csv file in python and print column and row of that value ?

Hello @Khanhh , Use panda to find the value of ...READ MORE

answered Oct 15, 2020 in Python by Niroj
• 82,820 points
0 votes
1 answer

How can I find out the index of an element from row and column in Python?

You probably want to use np.ravel_multi_index: [code] import numpy ...READ MORE

answered Apr 16, 2018 in Python by charlie_brown
• 7,780 points
0 votes
2 answers
+1 vote
2 answers

how can i count the items in a list?

Syntax :            list. count(value) Code: colors = ['red', 'green', ...READ MORE

answered Jul 7, 2019 in Python by Neha
• 330 points

edited Jul 8, 2019 by Kalgi 2,400 views
0 votes
0 answers
+5 votes
6 answers

Lowercase in Python

You can simply the built-in function in ...READ MORE

answered Apr 11, 2018 in Python by hemant
• 5,810 points
0 votes
1 answer

How to find the type of variable in Python?

i=277 type(i) # int i = 2.56j type(i) # complex i ...READ MORE

answered Jul 16, 2019 in Python by Arvind
• 3,000 points
+1 vote
1 answer