I need help to calculate compression of a PNG file in Windows 10 64-bit operating system. Formula is raw data size = image width * image heigth * (bits per pixel / 8).
Comment from the author of above formulas is sometimes 24 bit images are actually stored as 32 bit value. Is this file actually stored as 32 or 64 bit value ?
REFERENCE:
Estimating compression ratio of any image file is actually pretty simple. You have to know the width, height and bit depth of the image. To calculate how much data would be needed by uncompressed raw image data you have to do this simple thing: raw data size = image width * image heigth * (bits per pixel / 8). Then just divide raw data size by your PNG's file size by and you have the estimated compression ratio (not exact value because of the headers, etc.). For example, 640x480x32 image would need 640 * 480 * (32 / 8) which is 1 273 800 bytes. Now let's assume your PNG has 200kB. You divide (200 * 1024) / 1273800. That gives you a compression ratio of about 0.16.
How to know the compression level of a PNG file and whether it is lossy? - Super User