-1

I have a white-small.bmp file (32 x 32 px) and i need to get its pixel size to use it later in code. I wonder if there is a function for example: get_size_of_bmp('white-small.bmp') which returns int: 32*32 which is 1024 or list [32, 32], (1024 is enough information for my application)

1 Answers1

0

There is no builtin function that comes to my mind, but there is a library that enables you to get this information easly.

image = PIL.Image.open("image_name.bmp")
width, height = image.size
robocat314
  • 141
  • 8