Image Compressor topic guide

Image file size vs dimensions: why pixels do not equal bytes

Direct answer

Pixel dimensions and file size are related but not the same thing. A 2000 by 2000 JPEG at quality 80 might be 300 KB, while a 500 by 500 PNG with sharp edges and transparency could be 500 KB. The reason is that file size depends on five things, not one: pixel dimensions, compression format, quality or compression level, colour depth, and how complex the image content is. A flat white square compresses to almost nothing at any resolution; a photograph of a forest at the same resolution compresses to much more because there is more visual information to encode. Understanding this difference is the key to making real decisions about image preparation.

Try the Image Compressor

What this workflow handles

The five factors that determine file size are: (1) pixel dimensions — more pixels means more data, but the relationship is not linear because compression exploits redundancy between neighbouring pixels; (2) compression format — PNG is lossless and usually larger, JPEG is lossy and usually smaller, WebP and AVIF are newer and usually smaller still; (3) quality setting — a JPEG at quality 60 is much smaller than the same image at quality 95, but the lower quality shows visible block artefacts; (4) colour depth — a 24-bit PNG is larger than an 8-bit PNG of the same image; (5) image complexity — a flat-colour icon compresses to almost nothing, while a photograph of a crowd compresses to much more at the same dimensions and quality. MDN's Image file type guide, web.dev's image optimization guide and the Pillow documentation are the canonical references.

Use the image compressor to re-encode a single image in its original format at the same pixel dimensions, then compare the byte counts in the result panel before keeping the output.

How to use it

  1. Check the image's pixel dimensions and file size — both are visible in the result panel on any Beita Image tool page.
  2. If the file is a PNG and does not need transparency, convert it to JPEG for photographs or keep it as PNG for graphics with sharp edges.
  3. If the file is already a JPEG and still too large, re-encode it at a lower quality with the Image Compressor.
  4. If the file is for a website, convert it to WebP or AVIF for the smallest file at the same visual quality.
  5. If the file is for email or print, keep it as JPEG or PNG — most email clients and print pipelines do not decode WebP or AVIF.

Frequently asked questions

Why is my small image larger in file size than a bigger one?

Because file size depends on more than just pixel dimensions. A 500 by 500 PNG with sharp edges, text and transparency can be larger than a 2000 by 2000 JPEG of a soft photograph, because PNG is lossless and JPEG throws away data to reach a smaller file. The compression format, quality setting, colour depth and image complexity all affect file size independently of the pixel count.

Does reducing image dimensions always reduce file size?

Usually, but not always proportionally. Reducing a 4000 by 3000 image to 2000 by 1500 removes 75 percent of the pixels, but the file size usually drops by less than 75 percent because compression already exploited the redundancy between neighbouring pixels. MDN's Image file type guide explains that compression formats store differences between pixels, not raw pixel values, so fewer pixels does not always mean proportionally fewer bytes.

What has the biggest effect on image file size?

The compression format. Switching from PNG to JPEG for a photograph usually reduces the file by 60 to 80 percent at quality 80. Switching from JPEG to WebP usually saves another 25 to 35 percent at the same visual quality, per Google's WebP documentation. Switching from WebP to AVIF can save another 20 to 50 percent for photographs. The quality setting is the second-biggest lever: a JPEG at quality 60 is much smaller than quality 95.

Why is my PNG so much larger than my JPEG?

Because PNG is lossless — it preserves every pixel exactly, which means it cannot throw away visual data to shrink the file. JPEG is lossy and discards image data that the eye is less sensitive to, which produces a much smaller file at the cost of a small quality loss. MDN's format guide describes lossless and lossy compression as the fundamental distinction between the two formats. Use PNG for graphics and transparency; use JPEG for photographs.

How do I reduce file size without changing dimensions?

Re-encode the image at a lower quality setting in the same format, or convert it to a more efficient format. The Image Compressor here re-encodes in the source format at a balanced default quality; the WebP Converter changes the format to WebP at quality 85. Both keep the original pixel dimensions unchanged. For the smallest possible file on a website, convert to WebP or AVIF — web.dev's image optimization guide recommends both formats for performance work.

Explore the image compressor topic cluster

Each guide answers a different image-decision question. Pick the one that matches your situation, then use the linked tool to produce the output you need.

Related guides

  • Crop vs resize: how to fit an image into a target shape

    Crop keeps the target pixel dimensions and removes pixels at the edges of the source; resize keeps all of the source pixels and fits them into the target by scaling. A third option - letterbox - keeps all of the source and adds padding so the target aspect ratio is preserved. Pick by what the destination needs the image to do, not by which sounds simpler. Backed by the Pillow documentation, MDN and platform specs.

  • Resize vs Compress: which one actually shrinks your image

    Resizing changes the pixel dimensions of an image; compression keeps the dimensions and re-encodes the file at a smaller byte count. Pick resize when the source is larger than the display size, and compression when the dimensions are right but the bytes are still too high. Backed by Chrome for Developers' two Lighthouse audits and the Pillow documentation.

All image compressor guides