How to Compress Images Without Losing Quality
The phrase compress without losing quality describes something that is genuinely achievable, not a contradiction. The key is understanding what quality loss actually means at the level of human perception, versus what it means in terms of raw data.
When an image is compressed well, the data that gets removed is data your eyes would not have perceived anyway. The image looks identical. The file is dramatically smaller. To a viewer looking at both versions side by side, they are indistinguishable. That is what good compression does.
Poor compression, by contrast, removes data your eyes do notice: the sharp edges of text, the detail in a face, the texture in a fabric photograph. The image starts to look degraded in ways that are obvious on close inspection. This is what people are trying to avoid when they ask about compressing without losing quality.
The difference between the two outcomes is largely about which tool you use, what settings you apply, and whether you are starting from the original file. This guide covers all of that in plain terms.
Why Image Files Are So Large
Understanding why images are large makes the compression process make more sense.
Every digital image is essentially a grid of colored dots called pixels. Each pixel has a specific color value that is stored in the file. A photograph shot on a modern smartphone might be 4000 pixels wide and 3000 pixels tall. That is 12 million pixels, each with its own color data. At full precision, that is an enormous amount of information.
Image file formats manage this by using compression at the point of saving. JPEG achieves its small file sizes by analyzing what visual information the human eye actually perceives and discarding the rest. Our eyes are more sensitive to brightness differences than to color differences, and we are poor at detecting small variations in areas of similar color. JPEG exploits these perceptual limits to reduce file size while keeping the image visually intact.
PNG does something different. It compresses data by finding and encoding patterns and repetition without throwing away any information. The original can be perfectly reconstructed. This makes PNG files larger than JPEGs for photographs but ideal for graphics with large areas of flat color, sharp edges, and transparency.
The Single Most Important Rule
Before anything else: always start from the original file.
Every time you apply lossy compression to a JPEG image and save it again, the quality degradation compounds. You are applying compression to an already-degraded version, and the artifacts introduced by the previous compression get re-encoded alongside new ones. Two rounds of compression at 80 percent quality does not produce the same result as one round. It produces something noticeably worse, particularly in areas with fine detail.
The practical consequence of this is that you should keep your original uncompressed or minimally-compressed images saved separately in a location you will not accidentally overwrite. Always export your compressed versions from the original, not from a previous export.
Resize Before You Compress
Resizing an image to the actual dimensions it will be displayed at is often more effective than compression alone, and it involves no quality trade-off whatsoever.
If a photograph is 4000 pixels wide but will only be displayed at 800 pixels wide on a web page, it is carrying five times more data than it will ever use. No viewer will see any additional detail from those extra pixels at the intended display size. Reducing the image to 800 pixels wide removes that excess entirely, and the saved file will be dramatically smaller before any compression is applied.
The formula is simple: resize to the largest dimension the image will actually be displayed at, then compress. This two-step process consistently produces smaller files with better results than compression alone.
How to resize depends on what you have available. Squoosh handles both resizing and compression in the same interface. On a Mac, Preview can resize images through the Tools menu. On Windows, Paint handles basic resizing through the Resize option.
Understanding Compression Settings
Most tools offer a quality slider or a choice between named levels like low, medium, and high. Here is what those settings actually control.
For JPEG images, the quality setting determines how aggressively the algorithm discards imperceptible data. At 100 percent quality, almost nothing is discarded and the file is nearly as large as uncompressed. At 50 percent quality, a great deal of data is discarded and artifacts become obvious. The sweet spot where the image looks excellent but the file is dramatically smaller is typically in the range of 75 to 85 percent.
Below 70 percent, artifacts typically start becoming visible on close inspection, particularly around edges of text, fine details like hair or fabric textures, and areas of high contrast. Above 85 percent, the quality improvement relative to 80 percent is minimal while the file size increases meaningfully.
For PNG images, the compression level in most tools does not affect quality at all because PNG is always lossless. It only affects how thoroughly the tool searches for compressible patterns. Higher compression levels take longer to process but produce the same visual output. Tools like TinyPNG use more sophisticated algorithms than standard PNG encoders and can reduce PNG files by 60 to 80 percent with zero quality change.
The Best Tools for the Job
Squoosh
Squoosh is the most powerful free compression tool available for everyday use. It processes your images entirely inside your web browser with no server upload required. This is a genuine privacy advantage for images with personal content.
The interface shows the original and compressed versions side by side in real time. A draggable divider lets you compare them directly. As you adjust the quality slider, the visual result and file size update immediately. This live comparison makes it straightforward to find the quality setting where the image looks excellent and the file size is acceptably small, for each specific image individually.
Squoosh also supports WebP and AVIF output formats, which are modern alternatives to JPEG that produce smaller files at equivalent visual quality. For website images in particular, converting to WebP through Squoosh is one of the most effective steps you can take.
TinyPNG
TinyPNG is the most practical choice when you have multiple images to compress at once. You can upload up to 20 files simultaneously and it processes them all in parallel. Despite the name, it handles both PNG and JPEG files.
Its PNG compression algorithm is particularly effective. By intelligently analyzing and reducing the color data in a way the eye does not detect, it regularly achieves 60 to 80 percent file size reductions on PNG files with no visible change. For logos, icons, and illustrations, this is the easiest and most reliable option.
ImageOptim
ImageOptim is a free Mac application that processes images locally on your device with no uploads and no internet connection required. It runs multiple compression algorithms and keeps the best result, which makes it more thorough than tools that apply a single algorithm. There are no file size limits and no daily restrictions.
For Mac users who regularly work with images, ImageOptim is worth downloading once and using as the standard tool for PNG compression and lossless optimization.
A Simple Workflow That Works
If you want a reliable, repeatable process for compressing images for web use, this sequence covers it.
Start with your original high-resolution image. Do not work from a previously compressed version.
Open the image in Squoosh or your preferred tool and resize it to the maximum width it will be displayed at. For full-width web images, 1200 to 1600 pixels is typically sufficient. For smaller content images, 600 to 800 pixels is usually enough.
Export in WebP format at a quality setting of 80 to 85. If WebP is not suitable for your use case, export as JPEG at the same quality setting.
Open the compressed file and inspect it at actual size. Look at detailed areas like text, faces, and high-contrast edges. If it looks good at this size, it will look good to your visitors.
Check the file size. For typical web images, aim for under 200 kilobytes for standard content images. If you are significantly over that target, lower the quality setting slightly or check whether you can resize further.
Frequently Asked Questions
What is the best JPEG quality setting for web images?
80 percent is a widely used and reliable target. It is typically invisible compared to the original while producing files that are 60 to 80 percent smaller. For thumbnails where file size is particularly important, 70 to 75 percent is often still acceptable. Anything below 65 percent usually shows noticeable artifacts.
Can PNG be compressed without any quality loss?
Yes. PNG compression is always lossless. Tools like TinyPNG and ImageOptim reduce PNG file sizes through more efficient encoding of the same data. The visual result is identical to the original.
What happens if I compress a JPEG image multiple times?
Each lossy compression cycle on a JPEG degrades quality from the already-degraded version. The degradation is cumulative. Compress once from the original and keep the original archived.
Should I convert my photos to WebP?
For website use, converting to WebP is worth doing. WebP produces smaller files than JPEG at the same visual quality and is now supported by all major browsers and most devices. Squoosh makes this conversion straightforward.
How do I know when I have compressed enough?
Check the compressed file at the size it will actually be displayed. If it looks good at that size, the compression is appropriate. The target is the smallest file size at which the image looks good in its actual context, not the smallest possible file size.
