How to Compress Images Without Visible Quality Loss

To compress an image without visible quality loss, first resize it to the largest size it will actually be shown at, then choose the format by content: photos go to JPEG at quality 80 to 85 (or WebP or AVIF at a matched quality), while screenshots, logos and text go to lossless PNG or WebP. Lower the quality only while a side-by-side check at 100% zoom still looks the same. In our tests, resizing alone did more than any quality slider: a 4.3 MB phone photo became a 518 KB JPEG at 2000 pixels wide and quality 80.

For a quick JPEG export in your browser, use the FindPicked image compressor. This guide explains when that is the right tool, when it is not, and what the numbers look like. Every size and score below comes from files we encoded ourselves on November 17, 2026; the method is at the end.

The short version

  1. Check the destination. Note the maximum file size, accepted formats and the largest width the image will be displayed at.
  2. Resize first. A 4000-pixel photo shown 1000 pixels wide wastes most of its bytes.
  3. Pick the format by content. Photos: JPEG, WebP or AVIF. Screenshots, logos, diagrams: PNG or WebP lossless. Anything with transparency: PNG, WebP or AVIF, never JPEG.
  4. Lower the quality step by step. Compare the result with the original at 100% zoom, and stop one step before you can see a difference.
  5. Decide what happens to metadata. Remove location data before sharing; keep or convert the color profile so colors do not shift.

Step 1: Resize to the size people will see

File size grows with pixel count, so dimensions matter more than any quality setting. Our test photo is a 4000 × 3000 JPEG from a Samsung Galaxy S23 Ultra, published under CC0 in the WordPress photo directory. It weighs 4,335,887 bytes.

What we did File size Saving SSIM
FindPicked compressor at 90% (full size, Chrome 157) 3,264,074 B 25% 0.9724
FindPicked compressor at 80%, the default (full size) 2,009,664 B 54% 0.9523
FindPicked compressor at 60% (full size) 1,215,570 B 72% 0.9275
FindPicked compressor at 40% (full size) 884,111 B 80% 0.9097
Resized to 2000 × 1500, JPEG quality 80 518,136 B 88% 0.9443
Resized to 2000 × 1500, WebP quality 80 424,058 B 90% 0.9425
Resized to 2000 × 1500, AVIF quality 60 316,476 B 93% 0.9374
Resized to 1600 × 1200, JPEG quality 80 332,578 B 92% 0.9429

SSIM (structural similarity) compares the result with its reference: 1.0 means identical, and lower means more change. The resized rows are compared with a resized original, so their scores show compression damage only, not the lost resolution.

Of the four settings we tried at full resolution, only 40% fit under 1 MB, and at that setting the smooth sky showed visible blocks at 200% zoom. At 2000 pixels wide, the default quality of 80 already produced a 518 KB file. If you only need the target dimensions, the aspect ratio calculator gives you a height that keeps the proportions.

Our compressor does not resize yet, so resize first with any image editor, or with this built-in macOS command, which we ran:

# macOS built-in: longest side 2000 px (keeps EXIF and the color profile)
sips -Z 2000 photo.jpg --out photo-2000.jpg

That command produced an 899,994-byte JPEG from our test photo. The Python script in step 4 made a smaller file (518,136 bytes) because it lets you set the quality yourself.

Step 2: Choose the format by content

Lossy formats discard detail that is hard to see in photographs but easy to see around text and sharp edges. MDN’s image format guide makes the same distinction: prefer lossless encoding for screenshots, diagrams, logos and line art, and use lossy compression for photos.

Content Best choice Fallback Avoid
Photos AVIF or WebP JPEG PNG (very large)
Screenshots, UI, text, charts PNG (optimized) or WebP lossless PNG JPEG (larger and blurry text)
Logos and icons with transparency SVG if you have it, else PNG or WebP PNG JPEG (no transparency)

The formats themselves are well defined. PNG is lossless and supports an alpha channel. WebP supports lossy and lossless compression, transparency and animation. AVIF stores AV1-compressed images in the HEIF container. JPEG has no alpha channel at all.

Step 3: What each format saved in our tests

Photos. We encoded two standard Kodak test photos, the parrots (kodim23) and a detailed row of town houses (kodim08), both 768 × 512 lossless PNGs from the Kodak image suite. For each format, we searched for the smallest file that matched the SSIM of a quality-85 JPEG:

Image JPEG q85 WebP at equal SSIM AVIF at equal SSIM
Parrots (557,596 B PNG) 57,854 B 43,936 B (q88), 24% smaller 30,981 B (q67), 46% smaller
Houses (788,470 B PNG) 132,238 B 92,070 B (q79), 30% smaller 79,286 B (q67), 40% smaller

Two things stand out. Even a high-quality JPEG was about a tenth to a sixth the size of the lossless PNG. And the same quality number means different things in different formats: WebP needed quality 79 on one image and 88 on the other to match the JPEG.

At 200% zoom, the quality-85 JPEG of the parrots was very hard to tell from the original in our side-by-side check. At quality 40 (22,343 bytes), the red feathers turned blotchy and blocky. WebP at quality 75 and AVIF at quality 50 showed no blocks, but smoothed the fine feather texture. Each format fails differently, which is why a look at 100% beats any single number.

Screenshots. We also generated a 1200 × 800 dashboard-style screenshot with small text, thin lines and flat colors:

Version File size Note
PNG, Pillow optimize 57,655 B Lossless reference
PNG after oxipng -o 4 46,352 B Still lossless
PNG-8, 256 colors 23,855 B SSIM 0.9999; fine for flat UI, not for gradients
WebP lossless 15,692 B Pixel-identical
JPEG 80% from the FindPicked compressor 63,431 B Larger than the PNG, with halos around text

Converting this screenshot to JPEG made it bigger and worse. For images like this, a lossless optimizer such as oxipng or WebP lossless is the right tool.

Step 4: Compress, then compare at 100%

In the browser: open the image compressor, choose a photo and move the quality slider (10 to 100, default 80). It shows the original size, the new size and the saving, and the file never leaves your device. Then open the downloaded file next to the original at 100% zoom. Flip between them and look at faces, small text, fine texture and smooth skies, where artifacts show up first.

With Python, the script below resizes and writes all three photo formats. It uses Pillow (we ran Pillow 13.0.0):

import io
import sys
from PIL import Image, ImageCms, ImageOps

src = sys.argv[1]                       # e.g. photo.jpg
im = Image.open(src)
icc = im.info.get("icc_profile")
im = ImageOps.exif_transpose(im)        # apply the camera's rotation flag
im = im.convert("RGB")
if icc:                                 # convert Display P3 etc. to sRGB
    im = ImageCms.profileToProfile(
        im, ImageCms.ImageCmsProfile(io.BytesIO(icc)),
        ImageCms.createProfile("sRGB"), outputMode="RGB")
im.thumbnail((2000, 2000), Image.LANCZOS)   # longest side 2000 px

im.save("photo-2000.jpg", quality=80, optimize=True, progressive=True)
im.save("photo-2000.webp", quality=80, method=6)
im.save("photo-2000.avif", quality=60)

Run it as python3 shrink.py photo.jpg. It produced the 2000-pixel JPEG, WebP and AVIF rows in the first table. Pillow’s documentation notes that JPEG quality above 95 should be avoided because it creates large files with hardly any gain. The JPEG default is 75, WebP 80 and AVIF 75.

Step 5: Handle metadata and color on purpose

Photos carry more than pixels. Our test photo held an 852-byte EXIF block (camera model, capture time and an empty GPS section) and a Display P3 color profile.

  • Location and camera data. The FindPicked compressor’s output contained no EXIF at all, so it is a reasonable way to drop that data before sharing. sips kept the camera details and the GPS block. If privacy matters, check the result rather than assuming.
  • Rotation. A camera can store a photo sideways and add an EXIF orientation flag instead of rotating the pixels. We tested a sideways file with orientation 6 in the compressor: Chrome applied the flag, and the output came out upright with no flag needed.
  • Color profiles. This one is easy to miss. Pillow 13 drops the ICC profile when it saves JPEG or WebP unless you pass it explicitly. Without the profile, P3 pixel values are read as sRGB and the colors go duller. On our landscape, that shifted colors by an average of 1.46 ΔE2000 (95th percentile 2.31). The script above avoids this by converting to sRGB first. In our test the browser tool handled it correctly: Chrome converted the image to the canvas’s sRGB color space and, as the HTML canvas specification requires, embedded a profile saying so.

Step 6: Serve modern formats with a fallback

On a website, you do not have to pick one format. The HTML picture element lets each browser choose the best one it supports:

<picture>
  <source srcset="photo-2000.avif" type="image/avif">
  <source srcset="photo-2000.webp" type="image/webp">
  <img src="photo-2000.jpg" alt="Lake and green hills" width="2000" height="1500">
</picture>

MDN lists AVIF support from Chrome 85, Edge 121, Firefox 93 and Safari 16.1, and WebP support in all current major browsers. Upload forms, email clients and older software are another matter. When a site or form asks for “a JPEG under 1 MB”, give it exactly that.

What the FindPicked compressor does, and does not do

We loaded the tool’s page from a local build of this site in headless Chrome 157 and checked the files it produced. It:

  • Redraws your image on a canvas and exports a JPEG at the quality you choose, using the browser’s built-in encoder. Exact sizes can differ in other browsers. The HTML specification notes that implementations interpret “quality” slightly differently.
  • Keeps the original dimensions and does not resize.
  • Turns transparent areas black, because the canvas specification composites images onto opaque black for formats without alpha. Our transparent 1,274-byte logo became a 5,418-byte JPEG with a black background.
  • Can make PNG screenshots larger, as the table above shows. The tool then shows a negative saving.
  • Drops EXIF, applies the orientation flag and converts to sRGB, as described in step 5.

That makes it a good fit for the common job of getting a photo under an upload limit, and the wrong tool for logos, screenshots or anything transparent. The compress an image before uploading guide walks through that upload case in three steps.

How we measured

All encoding ran on macOS on November 17, 2026. We used Pillow 13.0.0 with libjpeg-turbo 3.2.0, libwebp 1.6.0 and libavif 1.4.2 (aom 3.14.1 encoder), oxipng through pyoxipng 9.1.1, and Chrome 157.0.8103.79 for the browser tool. JPEGs used optimize=True; WebP used method=6; AVIF used Pillow’s default speed 6. SSIM is scikit-image 0.26’s structural_similarity on RGB, configured to match Wang et al. (Gaussian weights, sigma 1.5). SSIM is a useful guide, not a guarantee of what you will see, so we also inspected crops at 200% and 300% zoom. Results vary with image content, encoder version and settings. Treat our numbers as one worked example, not a universal ranking.

Frequently Asked Questions

What JPEG quality setting should I use?

Start at 80 to 85 for photos and go lower only while a 100% zoom comparison still looks the same. In our tests, quality 85 scored an SSIM of 0.95 to 0.96 on two standard test photos, while quality 40 showed visible blocking. Quality numbers differ between tools, so judge the output rather than the number.

Is WebP or AVIF better than JPEG?

For photos they are usually smaller at the same measured quality. Matched to JPEG quality 85 by SSIM, our WebP files were 24 to 30 percent smaller and our AVIF files 40 to 46 percent smaller on two test images. Current major browsers support both, but keep a JPEG fallback for older software and for upload forms that accept only JPEG.

Why did my PNG screenshot get bigger after compressing it?

Converting a screenshot to JPEG often makes it larger and blurs text. Our 1200 by 800 test screenshot was 57,655 bytes as PNG and 63,431 bytes as JPEG at quality 80. Lossless optimization or WebP lossless worked better, bringing the same image down to 46,352 and 15,692 bytes.

Does compressing a photo remove its location data?

It depends on the tool. Our browser-based compressor writes a new JPEG without the original EXIF block, so camera details and any location tags are dropped. Other tools keep EXIF: the macOS sips command preserved it in our test. Check the output if privacy matters.