What Is a Raster Image File?

A raster image is a grid of individual picture elements called pixels, each storing color and brightness information. When you view a photograph on your monitor or smartphone, you're seeing a raster image rendered from millions of these tiny colored squares. Unlike vector graphics, which use mathematical formulas to define shapes, raster images record explicit data for every pixel position.

The file size of a raster image depends on two factors:

  • Spatial dimensions: measured in pixels wide by pixels tall
  • Bit depth: the number of bits allocated to describe each pixel's color

Common raster formats include JPEG, PNG, BMP, and TIFF. Without compression, a 1920 × 1080 photograph at 24-bit color depth requires roughly 6.2 megabytes of uncompressed storage.

Calculating Uncompressed Image File Size

File size depends directly on two variables: the total number of pixels and how many bits describe each pixel. Multiply these values to find the uncompressed size in bits.

Total pixels = width (pixels) × height (pixels)

File size (bits) = total pixels × bit depth

File size (bytes) = [total pixels × bit depth] ÷ 8

  • width (pixels) — Horizontal dimension of the image
  • height (pixels) — Vertical dimension of the image
  • bit depth — Number of bits assigned to each pixel (typically 8 to 64 for color images)

Understanding Bit Depth and Color Information

Bit depth determines how much color information each pixel can store. A single bit can represent only two values (0 or 1), so increasing bit depth exponentially increases the available color palette.

  • 1-bit: black and white only (monochrome)
  • 8-bit: 256 colors or shades of gray
  • 16-bit: 65,536 colors (sometimes called "High Color")
  • 24-bit: 16.7 million colors ("True Color", standard for photography)
  • 32-bit: 24-bit color plus 8-bit transparency channel (alpha channel)

Professional photography and graphic work typically use 24-bit or 32-bit depth to preserve fine color gradations and subtle tonal transitions. Web graphics often use 8-bit indexed color to minimize file size.

Practical Considerations for Image File Size

When working with digital images, account for these real-world factors that affect storage and workflow.

  1. Compression changes the equation — Uncompressed file size calculations ignore compression methods like JPEG, PNG deflate, or WebP encoding. Actual stored files are typically 5–50 times smaller depending on the image content and compression settings. Solid-color areas compress dramatically; photographs with random noise compress poorly.
  2. Resolution affects display, not file size — Screen resolution (72 dpi, 96 dpi, 300 dpi) is metadata about how to print or display an image, but it doesn't change the raw file size calculation. A 1920 × 1080 pixel image at 72 dpi and at 300 dpi occupy identical byte counts if uncompressed—only the physical print size differs.
  3. Transparency adds overhead — Images with alpha channels (32-bit instead of 24-bit) require an extra 8 bits per pixel for transparency information. If transparency is essential, account for this 33% increase in uncompressed size. Indexed-color formats like GIF use lookup tables instead, offering different compression trade-offs.
  4. Camera sensors exceed display needs — Modern digital cameras capture 20+ megapixels, far exceeding what typical displays require. Scaling down images to screen resolution (1920 × 1080) before storage or transmission reduces file size proportionally without visible quality loss in most web and social media contexts.

Practical Examples

Example 1: Full HD photograph
A 1920 × 1080 pixel image at 24-bit color contains 2,073,600 pixels. Multiply by 24 bits per pixel: 49,766,400 bits. Divide by 8 to convert to bytes: 6,220,800 bytes (approximately 6.2 MB uncompressed).

Example 2: Web thumbnail
A 200 × 200 pixel thumbnail at 8-bit grayscale is 40,000 pixels × 8 bits = 320,000 bits, or 40 KB uncompressed. Web browsers will apply additional PNG or JPEG compression, reducing this further.

Example 3: Professional print
A 4000 × 3000 pixel image suitable for large-format printing at 32-bit color (with alpha) requires 12 million pixels × 32 bits = 384 million bits, or 48 MB uncompressed. This is why photographers often work with compressed formats like NEF or CR2 during editing.

Frequently Asked Questions

How do I find the pixel dimensions of my image?

Right-click the image file on Windows and select Properties, then look for image dimensions. On macOS, right-click and choose Get Info. Alternatively, open the image in any graphics editor (Preview, Photoshop, GIMP, Paint.NET) and check Image menu > Properties or Image Size. Some metadata viewers display dimensions without opening the full application, useful for batch processing workflows.

Why does my actual image file size differ from this calculator's result?

This calculator estimates uncompressed raster data. Real-world image files use compression algorithms (JPEG, PNG, WebP) that reduce size by 80–95%. JPEG achieves high compression through lossy techniques that discard some color information. PNG uses lossless compression, preserving all data. The compression ratio varies with image content—photographs compress better than line drawings because random pixel variation is harder to predict algorithmically.

What's the difference between Full HD, 2K, and 4K resolutions?

Full HD (1920 × 1080) contains 2.07 million pixels. 2K (2560 × 1440) has 3.69 million pixels. 4K (3840 × 2160) contains 8.29 million pixels. Doubling linear dimensions quadruples pixel count. Choosing a resolution involves balancing image quality (more pixels = finer detail), file size, and display capability. Most computer monitors are Full HD; professional video production uses 4K; smartphones vary from 1080p to 2K or higher.

Do all image file formats use the same bit depth?

No. JPEG and PNG can store any bit depth up to 32-bit, but you specify it during export. GIF is limited to 8-bit indexed color (256 colors maximum). BMP supports 1, 4, 8, 16, 24, and 32-bit depths. RAW camera files store 12–16 bits per channel (36–48 bits total for RGB). Choose bit depth based on your use: web graphics often use 8-bit or 24-bit; photography and print use 24–32-bit; scientific imaging may use 16-bit for subtle gradations.

How does image resolution (dpi) relate to file size?

Resolution in dots per inch (dpi) is purely a print specification and does NOT affect file size. A 1920 × 1080 image is 1920 × 1080 pixels regardless of whether you mark it as 72 dpi (screen) or 300 dpi (print). The dpi value only tells a printer how large to render those pixels physically. Some software displays images smaller when dpi is high, but the underlying pixel data and byte count remain unchanged.

Can I predict how much the file will compress?

Compression ratio depends heavily on image content. Solid colors and gradients compress to 2–5% of original size. Photographs typically compress to 10–25% with JPEG at quality 85. Random noise or film grain compresses poorly (40–80% of original). PNG achieves roughly 30–50% compression on photographs. Use a compression estimator or test export your image with different settings to find the right balance for your needs—there's no universal compression factor across all images.

More other calculators (see all)