FORMAT GUIDE6 MIN READ

Why Compressed Images Get Bigger

Published

Why does image file size increase after compression? It happens when the new export uses a higher quality setting, a less efficient format, or keeps metadata that an earlier save had already stripped out. File size depends on pixel count, the compression algorithm, color depth and any embedded metadata, not on the word compressed alone, so a second pass can grow a file instead of shrinking it.

Why does file size increase after compression?

File size is the sum of several independent factors: how many pixels the image contains, how complex the content is, how many bits of color depth are stored, which compression algorithm is used, and how much metadata is attached. Running an image through a second export does not automatically reduce any of these. If the new settings raise the quality level, switch to a less efficient format, or add back metadata the original export had removed, the output can end up heavier than the file you started with.

Illustrative example: the quality-slider trap

This example is illustrative, not a measured test. Suppose a JPEG was first saved at a low quality setting to shrink it for a quick upload. If you later reopen that same file and re-export it at a high quality setting because you want to keep more detail, the encoder spends more bits preserving subtle gradients and texture. The result can be a larger file than the one you started with, even though you technically ran it through a compressor again.

How do pixel dimensions affect file size?

Pixel dimensions and compression settings are two separate levers. Resizing an image changes its width and height in pixels, and the file size then changes with how much pixel data is left to encode. Compression, on the other hand, re-encodes the same pixels more efficiently without touching width or height. When a browser decodes an image to display it, each pixel occupies a fixed amount of memory regardless of the original file format, which is why large pixel dimensions cost more even in an efficiently compressed file.

Illustrative example: resizing vs. compressing

This figure is illustrative. A photo at roughly 4000 by 3000 pixels contains about 12 million pixels. When a browser decodes it, each pixel takes up 4 bytes in memory, so the decoded image occupies tens of megabytes of RAM regardless of whether the stored file is a 2MB JPEG or a 2MB WebP. Reducing the pixel dimensions to something closer to 1200 by 900 lowers both the decoded memory footprint and the amount of data the encoder has to compress. Adjusting only a quality slider, without resizing, leaves the pixel count and that memory cost unchanged.

Does DPI or PPI matter for web images?

DPI and PPI are print-specific measurements that describe how densely pixels are packed onto physical paper. A browser ignores these tags entirely and renders an image based on its pixel dimensions alone. Changing a file from 72 DPI to 300 DPI in editing software does not add or remove pixels and does not change file size; it only changes a metadata value that tells a printer how large to reproduce the image on paper.

What role does metadata play in file weight?

Metadata such as EXIF camera settings, ICC color profiles and GPS coordinates is stored as extra bytes alongside the pixel data. Re-encoding a raster image during compression often strips this information, but not every tool behaves the same way, and some formats or pass-through exports keep it intact. You should check the exported file rather than assume all ICC profiles or GPS tags were removed, since that depends on the specific settings used.

Illustrative example: the metadata trap

These numbers are illustrative only, not a measured result. Imagine a 500KB photo run through an optimizer that reduces the pixel data but is configured to keep all metadata. If the original file carried 100KB of EXIF and color-profile data, the new file could still land around 550KB overall, because the metadata was preserved in full while the image data itself was only trimmed slightly. Checking the output for leftover metadata is the only way to confirm what actually happened.

How to properly optimize images for the web

Treat pixel dimensions, compression quality and metadata as three separate settings to check individually, since adjusting one does not automatically fix the others. The table below summarizes which setting controls which outcome.

GoalSetting to changeWhat it does not do
Reduce download weightLower the quality or compression levelDoes not change pixel dimensions
Reduce decode memory and layout sizeResize the pixel dimensions, then re-exportDoes not guarantee a smaller file unless re-compressed
Remove location or camera dataStrip metadata on export and verify the resultDoes not change pixel data or compression
Change physical print size onlyAdjust the DPI or PPI tagHas no effect on web file size, pixels, or rendering
  • →Compare the file size in bytes before and after, not just visually.
  • →Check the pixel dimensions to confirm no accidental upscaling happened.
  • →Open the file's properties or an EXIF viewer to see whether metadata was kept or removed.
  • →View the image in a browser at its real display size to judge whether quality is still acceptable.
  • →Remember that JPEG is lossy even at a high quality setting, and a visually acceptable result is not pixel-identical to the source.

A few limitations are worth keeping in mind. Browser decoding and encoding support varies, so being able to view an AVIF image does not prove that a given tool or browser can also encode AVIF. Not every browser supports every format, so do not assume a format like TIFF will display everywhere. GIF processing in most browser-based tools uses only the first frame, not the full animation, so it is not a substitute for proper video or animated export. For vector files, minifying an SVG typically removes only comments and whitespace rather than fully optimizing the paths, and vector images can usually be scaled without the quality loss or size change that affects raster photos.

Smaller image bytes can help a page's Largest Contentful Paint, but they do not directly improve server response time and do not guarantee any ranking outcome. Avoiding layout shift still requires reserving space for the image in your layout, not just reducing its file size, and the image that counts as your LCP element should never be lazy-loaded.

As a practical next step, open the original and the newly exported file side by side in a file explorer. Compare byte size and pixel dimensions, open an EXIF or metadata viewer to confirm what was kept, and view both images in a browser at their real display size before deciding which version to publish.

Ready to optimize your images?

TRY ZIPMYIMAGES FREE →

Related guides