Switching

Optimization

How to Reduce Image File Size (and How It Actually Works)

Lowering resolution and raising compression are not the same thing. Learn when quality loss is fine and how to shrink images for web and print the right way.

June 14, 2026· Last updated September 3, 2026

There are two ways to shrink an image file: resizing, which removes pixels, and compression, which keeps the pixels but discards information. Resizing wins by a wide margin. In our measurements, halving a photo's width from 1600px to 800px left a quarter of the pixels but dropped the file from 269KB to 33KB, an eightfold reduction. Resize to the pixels you actually need first, then close the remaining gap with quality.

There are two main ways to make an image smaller. Resizing cuts the number of pixels across and down. Compression leaves the pixel count alone and packs the data more tightly. The results differ, so picking the right one for the job is how you lose less quality. Knowing how each works also answers the usual complaints: why the image went blurry after you shrank it a lot, and why it still won't get small enough.

Lowering resolution (resizing)

Resizing reduces the width and height in pixels. Take a 4000×3000 photo down to 1600×1200 and the pixel count drops sharply, and the file size drops with it. Originals used on the web or on screen are usually much larger than the size they are shown at, so resizing to the display size trims the file without changing what people see.

Pixels you remove cannot be brought back, though. If you might print large later, keep the original somewhere else.

Increasing compression

Compression keeps the pixel count and lowers a JPG's quality value. Lower quality means a smaller file, but push it too far and colors clump together and blotches (artifacts) appear along edges. Photos hold up to a fair amount of compression. Images with lots of text or sharp lines get messy quickly.

Measured: how much does halving the width save?

People often say resizing beats compression, but rarely with numbers attached. We held JPG quality at 80 and reduced only the width of the same photo.

WidthPixel sizePixel countFile size
100%1600x10671,707,200269 KB
75%1200x800960,000105 KB
50%800x534427,20033 KB
25%400x267106,8005 KB
Quality fixed at 80; only the width changed. Measured by encoding three 1600x1067 (1.71MP) sources with libvips 8.18.3 and reading the actual byte counts.

Look at the halfway row. The pixel count falls to a quarter, but the file drops from 269 KB to 33 KB, roughly 8.1 times smaller. Fewer pixels means neighboring pixels resemble each other more closely, so compression efficiency rises alongside. That is why the size comes before the quality slider.

When quality loss is fine, and when it isn't

Before shrinking anything, ask whether the purpose can live with the loss.

  • Usually fine: social media uploads, images in a blog post, preview thumbnails, email attachments
  • Be careful with: printed material, product photos, text-heavy documents, originals you are archiving
  • Either way, don't delete the original. Keeping it next to the smaller copy means you can redo the work later

Web and print follow different rules

The web counts screen pixels, so matching the display size is enough, and for faster loading you can shrink boldly. Print counts dot density (usually around 300 dpi), so an image that looks fine on screen can come out soft on paper. For print, keep plenty of resolution and compress lightly.

Start from a target size

Often the size limit is decided before anything else: a 5 MB cap on attachments, 2 MB on a forum. In that case it is simpler to compress toward the target. Switching's compress tool fits the file under the size you set, and the resize tool handles the resolution. Both run in your browser, so the file never goes to a server.

Frequently asked questions

Does halving the width halve the file size?
No. Width and height both shrink, so the pixel count falls to a quarter, and the file usually falls further still. Our measurements went from 269KB at 1600px to 33KB at 800px and 5KB at 400px.
How many pixels do I need for screen use?
Body images on a blog look sharp at 1200 to 1600px wide, and thumbnails at 600 to 800px, even on high-density displays. Anything larger gets downscaled by the browser anyway, so the extra bytes are wasted.
Does compressing repeatedly shrink it further?
It does, but quality drops in visible steps. Lossy compression stacks new losses on top of information that is already gone, so saving once at your target quality looks considerably cleaner at the same file size.
Can I use the same targets for print?
No. Print works at 300 DPI, so a full A4 page needs roughly 2480x3508 pixels. An image reduced for the screen gets upscaled at print time and looks noticeably soft, so keep separate versions for screen and print.

Related tools