Formula
Each channel contributes bits divided by eight:
bytes = width × height × channels × bits / 8
A megabyte here is 1,000,000 bytes. Video file size uses a bitrate and a duration instead of pixels.
Assumptions
- There is no compression.
- Every pixel has the same channels and depth.
- The result is shown in decimal megabytes.
Worked example
A 4000 by 3000 image with 3 channels of 8 bits is 36 MB before compression.
Input definitions
- Channels
- Three is typical for red, green, and blue. Four leaves room for an alpha channel.
- Bits per channel
- How many bits store one channel of one pixel. Eight is a common photo.
Limitations
This is a planning figure from the numbers you type. It is not a measurement of a network, a camera, a printer, or a power supply.
Questions
Why is a JPEG smaller?
This page stores every sample. A compressed file keeps less, so it is a different number.
Is this megapixels?
No. Megapixels are width times height divided by one million. This page also multiplies by the bytes in each pixel.