im=Image.open ("trial.jpg")              

a = im.resize((300,300), Image.ANTIALIAS)   
b = a.save("im.jpg")

im1 = Image.open ("im.jpg")
loadres = numpy.array(im1)

ive resized image trial to 300x300 image and saved it as im.jpg.
but once i turn it into an array and check image sizes this is what i get

>>> im.size
(450, 400)
>>> im1.size
(300, 300)
>>> loadres.size
270000

loadres seems to have the combined size of im and im1 (450x400 = 18k) + (300x300 = 9k)
loadres.size = 18k+ 9k = 27k

any ideas as to why?

Recommended Answers

All 2 Replies

jpeg quality setting is same in the files as checked in image editor like IrfranView?

But, wait a moment the size looks right for me:
3 primary colors * 300 * 300 == 270 000

thanks sir! i thought every element is a 3 element tuple. got me confused

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.