What image compression actually does

Compressing an image makes the file smaller so it takes up less storage space and uploads or downloads faster. The image itself stays the same size on your screen — compression removes data from the file, not pixels from the picture.

There are two ways to compress: lossy compression removes some image data permanently to shrink the file more aggressively, and lossless compression reorganizes the data without throwing anything away. For photos, lossy usually looks fine. For screenshots, diagrams, or anything with text, lossless keeps the sharpness.

Most image files you encounter are already compressed to some degree. A JPEG is lossy by default. A PNG is lossless. A raw file from a camera is barely compressed at all, which is why it takes up so much space.

Key Takeaways

  • Lossy compression (JPEG format) shrinks photos much more than lossless, and the difference is usually invisible unless you compress very aggressively.
  • Lossless compression (PNG format) keeps every detail but does not shrink files as much, so use it for screenshots and images with text.
  • Online tools like TinyPNG, Compressor.io, and ImageOptim work in your browser without installing software, though they upload your image to their servers.
  • Desktop software like IrfanView (Windows) and Preview (Mac) compress locally on your computer and give you more control over quality settings.
  • Batch compression tools let you shrink dozens of images at once instead of one at a time.

Compressing photos with JPEG format

JPEG is the standard format for photographs because it compresses them to a fraction of their original size while keeping them visually sharp. When you save a photo as JPEG, you choose a quality level — usually a number from 1 to 100, where 100 is highest quality and largest file size.

For most purposes, a quality setting of 75 to 85 looks identical to the original to the human eye, but cuts the file size in half or more. A setting of 60 to 70 is fine for web use and email. Below 50, you start to see visible artifacts — blocky areas and color banding — especially in areas with gradual color changes like skies.

If you are converting an existing image to JPEG, use your image editor's "Export As" or "Save As" option, not "Save" — that preserves the original file in its current format. In Windows, right-click the image, choose "Open with" and select Paint, then go to File > Save As and pick JPEG. On Mac, open the image in Preview, go to File > Export, and choose JPEG from the Format dropdown.

Compressing screenshots and graphics with PNG format

PNG is lossless, meaning it keeps every pixel exactly as it was. This makes PNG essential for screenshots, diagrams, charts, and anything with text or sharp edges, because JPEG compression blurs text and creates halos around lines.

PNG files are larger than JPEG for the same image, but they compress better than you might expect because PNG uses a smarter compression algorithm. A screenshot saved as PNG is usually smaller than the same screenshot saved as JPEG at low quality, and it stays sharp.

To save as PNG in Windows Paint, go to File > Save As and choose PNG from the dropdown. In Mac Preview, go to File > Export and select PNG. Most image editors default to PNG for screenshots automatically.

Using online compression tools

Online tools like TinyPNG (tinypng.com), Compressor.io (compressor.io), and ImageOptim (imageoptim.com) let you upload an image and download a compressed version without installing anything. You drag the image into the browser window, the tool processes it, and you download the result.

TinyPNG handles both JPEG and PNG and uses smart lossy compression that often looks better than you would expect at the same file size. Compressor.io lets you adjust the quality slider before downloading. ImageOptim compresses losslessly and works on Mac or through the web.

The trade-off is that your image is uploaded to the company's servers temporarily. If you are compressing sensitive images, this is a reason to use desktop software instead. Most of these tools are free for a reasonable number of images per month, though they offer paid plans for bulk compression.

Compressing images on your computer

Desktop software gives you more control and keeps your images private. On Windows, IrfanView (irfanview.com) is free and handles batch compression — you can select 50 images at once and compress them all with the same settings. Open the image, go to File > Save As, choose JPEG or PNG, and adjust the quality slider before saving.

On Mac, the built-in Preview app compresses automatically when you export. Open the image, go to File > Export, choose your format, and use the Quality slider. For batch work on Mac, ImageMagick is free but requires command-line knowledge.

Windows 10 and 11 also have a built-in option: right-click an image, choose "Compress pictures" from the context menu. This opens a dialog where you can choose compression level and apply it to multiple images at once. The results are usually good for general use.

Batch compression for multiple images

If you have dozens of images to compress, doing them one at a time wastes time. Most desktop tools let you select a folder of images and compress them all with the same settings.

In IrfanView on Windows, open the Batch Conversion dialog (File > Batch Conversion), select the folder containing your images, choose JPEG or PNG as the output format, set the quality, and click Start. IrfanView processes all of them and saves the compressed versions to a folder you specify.

On Mac, Preview does not batch compress, but you can use Automator to apply compression to multiple files. Open Automator, create a new Quick Action, add the "Scale Images" action, set your desired size, and save. Then select multiple images in Finder, right-click, and choose your Quick Action from the Services menu.

Choosing between formats and quality levels

Image TypeBest FormatRecommended QualityWhy
PhotographsJPEG75–85Lossy compression shrinks photos dramatically; quality is visually identical
ScreenshotsPNGLosslessText and edges stay sharp; PNG compresses well for this type
Diagrams and chartsPNGLosslessLossless keeps lines and colors exact
Web thumbnailsJPEG60–70Smaller file size matters more; quality loss is not visible at small size
Images with textPNGLosslessJPEG blurs text; PNG keeps it readable

Frequently Asked Questions

Can I compress an image multiple times without losing quality?

With lossless formats like PNG, yes — you can compress and decompress as many times as you want with no loss. With JPEG, no — each time you save as JPEG, you lose a little more data. Save your original in a lossless format and only convert to JPEG when you are ready to share.

What is the smallest file size I can get without the image looking bad?

For photos, JPEG at quality 70–75 usually looks identical to the original but is half the file size. For web use, quality 60 is often fine. The only way to know is to compress a test image, look at it on your screen, and adjust the quality slider until you see visible artifacts, then back off a little.

Is it safe to use online compression tools with private images?

Most reputable tools delete your image from their servers after you download it, but they do briefly store it. If you are compressing sensitive or confidential images, use desktop software instead — it keeps everything on your computer.

Why is my PNG file bigger than the original JPEG?

PNG is lossless, so it stores more data. If you converted a JPEG to PNG, you did not gain any quality — you just made the file bigger. Convert to PNG only if you need lossless compression going forward, not if you are starting with a JPEG that was already compressed.

Can I compress an image to a specific file size?

Most tools let you set quality, not file size directly. You compress, check the result, and adjust the quality slider until the file size is close to what you want. Some online tools show you the file size before you download, so you can try different quality levels without committing.