Uncompressed size is exact
Every pixel stores one value per channel, and each value occupies the bit depth. So:
bytes = width × height × channels × (bit depth ÷ 8)
For a standard 8-bit RGB image that simplifies to width × height × 3.
- 4000 × 3000 RGB, 8-bit
- 4000 × 3000 × 3 = 36,000,000 bytes ≈ 34 MB
- 1920 × 1080 RGB, 8-bit
- 1920 × 1080 × 3 = 6,220,800 bytes ≈ 5.9 MB
- 1920 × 1080 RGBA, 8-bit
- × 4 instead of × 3 ≈ 7.9 MB
- 4000 × 3000 RGB, 16-bit
- × 6 ≈ 69 MB
This is the number a browser actually holds in memory while processing an image, which is why large batches exhaust a tab long before the files on disk look large.