Tuesday 17 September 2019

Why is image size and the memory required to display it different?

I learned from a stack overflow post that the memory required to display an image and the image size is equal to


4 * image dimensions

I have some 800x800 images and I see that its size is about a hundred KB, which I think is quite small. But according to the formula above, it needs more than 2MB to display it!


The SO post says that because the bitmap is using ARGB colors, each pixel requires 4 bytes of storage space. So that's why the formula is 4 * image dimensions. But I see that only 100KB of space is required to store the image!


Does the computer use a different method to store the image? Does 1 pixel still needs 4B to be stored? How is this happening?

No comments:

Post a Comment

How can I VLOOKUP in multiple Excel documents?

I am trying to VLOOKUP reference data with around 400 seperate Excel files. Is it possible to do this in a quick way rather than doing it m...