How to Compress JPG Images Without Noticeable Quality Loss
Published 4 min readBy SlimMyFile
JPEG compression is lossy, so "without any loss" is not technically possible when you re-encode a JPEG. What is possible, and what most people actually want, is a much smaller file that looks the same to a viewer. The key is understanding which settings are invisible and which ones start to show.
How JPEG compression works, briefly
A JPEG encoder divides the image into small blocks of 8×8 pixels and describes each block as a mix of smooth patterns. Fine, high-frequency detail is stored with less precision, and colour is usually stored at lower resolution than brightness (called chroma subsampling), because our eyes are much more sensitive to brightness than to colour.
The quality setting controls how much precision is thrown away. It is not a percentage of the original quality. A setting of 80 does not mean "80% as good"; it is simply a position on the encoder’s scale, and different programs map the same number to slightly different results.
Choosing a quality setting
These ranges are good starting points with the MozJPEG encoder used by SlimMyFile:
| Quality | Typical result | Use it for |
|---|---|---|
| 85–90 | Practically indistinguishable from the original | Photos you may print or edit later |
| 70–80 | Differences only visible on close inspection | Websites, email, social media, online forms |
| 50–65 | Visible softness in fine textures | Thumbnails and previews where size matters most |
| Below 50 | Blocky artefacts and colour smearing | Rarely worth it |
The best value depends on the picture. Busy scenes with foliage or gravel hide compression well; smooth gradients such as skies, studio backgrounds and skin show artefacts sooner. Always compare before and after at 100% zoom.
Resize first: the biggest win
Modern phones produce photos around 12 megapixels or more, roughly 4000 pixels wide. If the photo will be displayed 1200 pixels wide, resizing it first removes about 90% of the pixels, because the pixel count falls with the square of the width. That usually shrinks the file far more than any quality setting, with no visible loss at the size the photo is actually shown.
For high-density "retina" screens, a common approach is to export at about twice the displayed width. See our guide on resizing images without distortion for choosing target dimensions.
Step by step with SlimMyFile
- Open the JPG compressor and add one or more photos. Nothing is uploaded; the files are processed in your browser.
- Pick the Balanced preset (quality 80) as a starting point, or set the quality slider yourself.
- If the photos are larger than they need to be, enable Resize images and choose a percentage or a target width.
- Click Compress, then use Compare to check the before and after views of each photo.
- If you see artefacts, raise the quality and apply the new settings. If the files are still too large, lower the quality a little or resize further.
- Download photos one at a time or all together as a ZIP.
MozJPEG produces progressive JPEGs with optimised Huffman tables, which typically makes files smaller than a basic encoder would at the same quality setting. If a re-encoded photo ends up larger than the original, which can happen when the original was already heavily compressed, SlimMyFile keeps your original instead.
Things that quietly change when you re-encode
- Metadata: EXIF data such as camera model, date and GPS location is not carried over. That is often a privacy benefit, but keep the original if you need that information.
- Orientation: phones often store photos sideways with a "rotate" tag. SlimMyFile applies the rotation to the pixels first, so the result stays upright everywhere.
- Colour profiles: images are processed in the standard sRGB colour space used by the web. Photos captured in wide-gamut profiles may look slightly less saturated on wide-gamut displays.
Common mistakes
- Recompressing the same JPEG repeatedly. Each lossy pass removes a little more detail. Keep the original and always compress from it.
- Judging quality from a small thumbnail. Artefacts are easy to miss when the image is scaled down; check at full size.
- Using JPEG for screenshots or graphics with text. Use PNG or high-quality WebP instead (see JPG vs PNG vs WebP).
- Converting a JPEG to PNG to improve it. Lost detail cannot be recovered, and the file becomes larger.
Frequently asked questions
What is the best JPEG quality for websites?
Around 70–80 works well for most photos, combined with resizing to the displayed dimensions. Check images with smooth gradients more carefully, and raise the quality for those.
Why is my compressed JPEG bigger than the original?
The original was probably saved at a lower quality than the one you chose. Re-encoding at a higher quality cannot add detail back but does use more bytes. Lower the quality setting, or keep the original.
Try it with SlimMyFile
Compress JPG
Smaller JPEG photos with the MozJPEG encoder.
Open toolResize Images
Change dimensions by percentage or exact pixels.
Open toolRelated guides
- Images
JPG vs PNG vs WebP: Which Image Format Should You Use?
A practical comparison of JPEG, PNG and WebP: compression type, transparency, compatibility and the best format for photos, screenshots and logos.
4 min readRead guide - Images
How to Resize Images Without Distorting Them
Aspect ratios explained, how to pick target dimensions, and why shrinking an image is safe while enlarging it is not.
3 min readRead guide - Compression basics
Lossy vs Lossless Compression Explained
What lossy and lossless compression actually do, which formats use each, and how to choose without damaging your files.
3 min readRead guide