By the ImageOpti team ·
How to Reduce Image File Size Without Losing Quality
Learn the four things that decide an image's file size, and the order to fix them in, so you can shrink photos a lot while keeping them sharp on screen.
You can usually cut an image's file size by 70 to 90 percent without anyone noticing a difference, as long as you fix the right things in the right order. First, make the pixel dimensions no larger than the size the image will be displayed at. Second, choose a suitable format. Third, apply a moderate amount of compression and check the result by eye.
"Without losing quality" needs one honest caveat. Almost every method of making a photo much smaller throws away some information. The goal is to throw away only what nobody can see at the size the picture will be viewed. This article explains what controls file size, how to work through the steps, and how to avoid the mistakes that do cause visible damage.
What actually decides file size
Four things determine how many kilobytes an image takes up.
- Pixel dimensions. The number of pixels is width times height. More pixels means more data to store.
- Format. JPEG, PNG and WebP store the same pixels in very different ways.
- Compression level. For lossy formats, a quality setting controls how much detail is discarded.
- Content. A photo of a clear sky compresses far better than a photo of a gravel path, because smooth areas are easier to describe with less data.
You control the first three. Most people only touch the third, which is why they get disappointing results. The first one is usually the biggest lever.
Why pixel dimensions matter most
An uncompressed image needs roughly 3 bytes per pixel (one each for red, green and blue). Compression shrinks that a lot, but the starting point still scales with pixel count.
Take a typical phone photo of 4000 by 3000 pixels. That is 12,000,000 pixels. If your blog column shows images at 800 pixels wide, the visitor's browser downloads all 12 million pixels and then shrinks them down to about 800 by 600, which is 480,000 pixels. You made them download 25 times more pixels than they can see.
If you resize that photo to 1600 by 1200 (twice the display width, which keeps it sharp on high-density screens), you have 1,920,000 pixels. That is 16 percent of the original, and the file size will typically fall by a similar proportion before you have applied any compression at all.
Halving both width and height leaves a quarter of the pixels. That is a handy rule of thumb: every time you halve the dimensions, the file usually becomes roughly four times smaller.
Step 1: Work out the size you really need
Before touching any tool, decide where the image will be shown. A few typical cases:
| Where it goes | Reasonable pixel width |
|---|---|
| Blog or article body | 1200 to 1600 |
| Full-width banner on a website | 1600 to 2000 |
| Product thumbnail in a grid | 400 to 800 |
| Email body image | 600 to 800 |
| Profile picture | 400 to 800 |
These are typical ranges, not rules. If your site layout is 700 pixels wide, a 1400 pixel image is the most you will ever benefit from. Going beyond that adds weight and no visible sharpness.
Use the resizer to set the width, and leave the aspect ratio locked so nothing stretches. If the shape is wrong for the space, crop first with the cropper so you are not shrinking parts of the picture you plan to discard.
Step 2: Pick the right format
The wrong format can make a file ten times larger than it needs to be.
- Photographs belong in JPEG or WebP. These lossy formats are built for the smooth gradients of real scenes.
- Logos, icons, screenshots with text, and flat graphics suit PNG, or lossless WebP, because they have sharp edges and few colours.
- A photo saved as PNG is a very common cause of huge files. If it does not need a transparent background, converting it to JPEG or WebP can shrink it dramatically.
If you are unsure, the guide to PNG vs JPG vs WebP goes through the trade-offs. When you do need to switch, the converter handles it in your browser.
Step 3: Apply compression and check it
Once the dimensions and format are right, compression does the final squeeze. In the optimizer you get a quality slider that starts at 75. For most photos viewed on screens, that is a sensible starting point, and the savings are large.
Here is how the quality number generally behaves for JPEG and WebP. The exact results vary from image to image, so treat these as typical behaviour rather than fixed values.
| Quality setting | What you typically see |
|---|---|
| 90 to 100 | Very high fidelity, but the file is large and the extra detail is rarely visible |
| 70 to 85 | Usually looks the same as the original at normal viewing size, with a much smaller file |
| 50 to 70 | Fine for small images and thumbnails, slight softness may appear in detail |
| Below 50 | Blockiness and smeared detail become noticeable, especially in skies and gradients |
The most important habit is to look at the result. The optimizer shows a before and after comparison with a draggable handle. Zoom into areas with fine detail, such as text, hair, foliage or edges against a plain sky. If you cannot spot a difference at the size the picture will actually appear, you can try lowering the quality further. If you can, raise it.
The diminishing returns curve
Quality and file size do not move together in a straight line. Going from 100 to 85 often removes a large share of the file. Going from 85 to 70 removes a smaller share. Below that, each step saves less and costs more in visible damage. This is why the middle of the slider is where most people should live.
Step 4: Know when to stop
Some files will not shrink much more, and that is normal.
- Already-compressed images. A picture downloaded from social media or exported at low quality has had most of its removable detail stripped. Re-compressing it saves little and adds artifacts.
- Very noisy photos. Night shots with sensor grain, or images with fine texture all over, have a lot of detail that is hard to remove invisibly.
- Small images. A 20 KB icon does not need more work.
Do not run the same file through compression repeatedly. Each pass on a lossy file layers new artifacts over the old ones. Always go back to your original and process it once with the settings you want.
A worked example
Suppose you have a product photo straight from a phone: 4032 by 3024 pixels, saved as a JPEG of about 3.5 MB. You want it on a shop page where it displays at 900 pixels wide.
- Resize. Set the width to 1800 pixels (twice the display width). The height becomes 1350. The pixel count drops from about 12.2 million to about 2.4 million, which is 20 percent of the original. The file will typically land somewhere around 600 to 900 KB just from that.
- Check the format. It is a photo, so JPEG is fine.
- Optimize. Run it through the optimizer at the default quality. A further reduction to roughly 150 to 300 KB is typical for a photo like this, though it depends on the content.
- Compare. Drag the comparison handle. If the product edges and any text on the label still look clean, you are done.
The final file might be about 5 to 10 percent of the original size, and at 900 pixels wide on the page, a shopper cannot tell the difference. These figures are illustrative of the typical order of magnitude, not a guarantee, since every photo behaves a little differently.
Common mistakes that cause visible damage
- Saving over the original. Always keep the untouched file. Lossy changes cannot be reversed.
- Compressing and then resizing. Resizing after compression forces a second lossy save. Resize first, compress once.
- Enlarging a small image. Making an image bigger invents pixels and looks soft. If you need a larger version, find a larger source. The resizer here only reduces, for this reason.
- Chasing the smallest possible number. A 40 KB file that looks smeared is worse than a 120 KB file that looks clean.
- Ignoring display size. A 5 MB hero image will slow a page even when it looks fine, because the cost is in the download.
A simple order of operations
- Crop to the right shape.
- Resize to the display width, or up to twice that for sharper results on high-density screens.
- Convert to a sensible format if needed.
- Optimize once, at a moderate quality, and compare.
- Keep your original somewhere safe.
If your goal is a faster site specifically, the checklist for compressing images for a faster website covers the wider picture, including how images affect page load. For a deeper look at what lossy and lossless really mean, see lossy vs lossless compression explained.
FAQ
Is it possible to reduce file size with no quality loss at all?
Yes, but only a little. Lossless methods, such as the way PNG is repacked, can trim a file without changing a single pixel. For photos, the savings are small. Big reductions come from fewer pixels or lossy compression.
Does shrinking the file size mean the picture will print worse?
It can. Printing needs more pixels than screens do, so an image reduced for the web may be too small for a good print. Keep your high-resolution original for printing and make a separate web copy.
What quality setting should I use?
For photos on screens, something between 70 and 85 is a good place to start, and 75 is a reasonable default. Check the comparison and adjust. There is no single correct number because it depends on the image.
Why did my file get bigger after optimizing?
The file was probably already compressed harder than your chosen setting, so re-encoding it added overhead. In that case, keep the original, or lower the quality if you need it smaller.
Are my images uploaded when I use these tools?
No. The resizer, optimizer, cropper and converter run in your browser, so your files stay on your device.
Related guides
For the wider picture, read the image optimization guide for websites.