Dimensions, ratio and megapixels
A 6000 × 4000 image contains 24 million pixels, or 24 MP, and has a 3:2 aspect ratio. Two images with the same dimensions can have very different byte sizes due to format, compression and metadata.
- Dimensions: width × height
- Megapixels: width × height ÷ 1,000,000
- Aspect ratio: simplified width:height
- File size: encoded bytes
Why parsers read headers first
Header-level checks can reject implausibly large dimensions before decoding pixels. This protects memory and keeps malformed files away from expensive browser image decoders.
Dimensions answer size, not quality
Pixel dimensions tell you how many samples the file contains across width and height. Megapixels summarize their product, but neither value can evaluate focus, motion blur, noise, compression damage or whether the subject is useful.
A 24-megapixel image can be poor, while a carefully made 2-megapixel image can be perfect for a small web placement. Compare dimensions with the destination requirement rather than chasing the largest number.
- Web layout uses displayed CSS size
- High-density screens may need more source pixels
- Print size depends on target PPI
- Cropping reduces available dimensions
How the calculation and guard differ
The lab calculates width multiplied by height, then reports megapixels to two decimals. A separate 80-megapixel limit stops expensive decoding in browser tools. The limit is about predictable memory use, not a recommendation to discard large originals.
Decoded memory can be much larger than the compressed file. A 12,000 × 8,000 RGBA surface needs roughly 384 million bytes before working buffers, previews or output are counted.
Check the real header before planning
Do not infer dimensions from a filename, extension or a website thumbnail. Read the actual container header and reject impossible or truncated values before allocating memory.
For print, divide pixels by a chosen pixels-per-inch target. For web, compare the source dimensions with the maximum rendered size and responsive variants. Keep the original even when a smaller derivative is more efficient online.
What this does not prove
A metadata result describes the fields and structures that the supported parser could read. It does not, by itself, prove authenticity, intent, authorship or the truth of the visible scene.