I am trying to calculate the size of image in K bytes based on the image width and height in pixel and the bit depth and check it with its size. I have applied 2 formulas:
but every time I got a size result different from the on showed in the image properties window. For example:
When applying the formulas I got a size different and way bigger than 467 Kb.
I am wondering if I am using the wrong formula. How can I get the same image size based on width, height and bit depth?
You gotta follow these steps:
So your example will be:
(Height * width) = result1
result1 * bit depth = result2
result2 / 8 = result3
result3 / 1024 = finalresult
Finally we must have:
(Height * width * bit depth) / (8 * 1024)
If the bit depth is 8, you'll have:
(Height * width * 8) / (8 * 1024) = (Height * width)/1024