import PIL
import numpy as np
from PIL import Image
im = Image.open('youngerlrf005.jpg')
a1 = np.array()
width, height = im.size
for i in width:
if i < 100:
i = 0
i = i+1
else:
i = 1
i = i+1
i.append(a1)
for j in height:
if j < 100:
j = 0
j = j+1
else:
j = 1
j = j+1
j.append(a1)
print(a1)
I am trying to get the image size in python but not using with inbuilt methods. I am not able to get the o/p as expected. I want to print the size of the image in the binary format in the matrix.
np.append(a1, j)instead ofj.append(a1).