What image compression does and when you need it
Image compression reduces the file size of a photo or graphic so it takes up less storage space and transfers faster over email or the web. The two main approaches work differently: lossy compression removes some image data permanently to shrink the file more aggressively, while lossless compression reorganizes the data without throwing anything away, so you can restore the original if needed.
You compress images when you want to email a photo without hitting attachment limits, upload pictures to a website faster, or free up phone storage. The trade-off is that lossy compression visibly degrades the image — colors flatten, fine details blur, and you cannot undo it. Lossless compression keeps the image identical but shrinks it less dramatically.
Most people use lossy compression for photographs and web images, where a small quality loss is invisible to the eye. Use lossless compression for screenshots, diagrams, or images where every pixel matters, or when you want to preserve the original and may need to compress it differently later.
Key Takeaways
- Lossy compression removes image data to shrink files dramatically but permanently changes how the photo looks, while lossless compression reorganizes data without loss and works best for graphics and screenshots.
- JPEG format is lossy and works well for photographs; PNG is lossless and better for images with text or sharp edges; WebP offers better compression than both but not all devices support it yet.
- Most image compression happens when you save or export a file in a new format or adjust the quality slider, not through a separate compression step.
- Online tools like TinyPNG and Squoosh let you compress images in a browser without installing software, though uploading sensitive photos to a web service carries privacy considerations.
- Batch compression tools and built-in operating system features can shrink multiple images at once, which is faster than compressing one at a time.
Lossy vs. lossless: which compression method to use
Lossy compression is what most people mean when they say "compress an image." It permanently deletes data the algorithm decides is less important — usually fine color gradations and small details your eye would not notice anyway. The result is a much smaller file, often 50 to 80 percent smaller than the original, but the image is changed forever. You cannot restore the original detail by decompressing it.
Lossless compression reorganizes the image data so it takes up less space but contains all the original information. When you decompress it, you get back exactly what you started with. The file shrinks less dramatically — typically 10 to 30 percent — because the algorithm cannot throw anything away. Lossless works by finding patterns in the data and storing them more efficiently, the same way a ZIP archive works.
For photographs and casual snapshots, lossy compression is the right choice because the quality loss is invisible at normal viewing sizes. For screenshots, diagrams, logos, or any image with text or sharp edges, use lossless compression because lossy compression makes text blurry and colors muddy. If you are unsure, start with lossless — you lose less quality and can always compress further later if you need a smaller file.
File formats and which one shrinks your image most
The file format you choose determines how much compression is possible and whether it is lossy or lossless. JPEG is lossy and the standard for photographs — it compresses aggressively and most devices open it when ready. When you save a JPEG, you choose a quality setting (usually 1 to 100, where 100 is highest quality). Setting it to 75 or 80 gives you a file about one-third the size of the original with no visible quality loss for most photos.
PNG is lossless and works best for graphics, screenshots, and images with text. It compresses less than JPEG but preserves every pixel. PNG files are larger than JPEG for photographs but smaller than JPEG for images with solid colors or sharp edges. WebP is a newer format that compresses better than both JPEG and PNG — a WebP file is typically 25 to 35 percent smaller than an equivalent JPEG — but older phones and browsers do not support it yet. Use WebP if your audience uses recent devices or if you control the website where the image appears.
GIF is lossless but only supports 256 colors, so it is useful only for straightforward graphics or animations. TIFF is lossless and high-quality but produces very large files, so it is mainly for archival or professional printing, not for sharing or storage.
Compressing images on Windows, Mac, or Linux
On Windows, right-click an image file, select "Open with" and choose Photos or Paint. In Photos, click the three dots menu and look for an export or save option where you can adjust quality. In Paint, go to File > Export As, choose JPEG format, and click the quality slider before saving. For multiple images, use the built-in Photos app batch export: select all the images you want, right-click, and choose "Open with Photos," then export them all at once with a single quality setting.
On Mac, open the image in Preview (the default image viewer), go to File > Export, choose JPEG from the format dropdown, and drag the Quality slider before saving. Preview also has a Tools menu with a Reduce File Size option that compresses automatically. For batch compression, open multiple images in Preview, select them all, then use File > Export to save them all with the same settings.
On Linux, use ImageMagick from the command line — the command convert input.jpg -quality 75 output.jpg compresses a JPEG to quality 75. For a graphical tool, install GIMP (GNU Image Manipulation Program), open the image, go to File > Export As, choose JPEG, and adjust quality before saving. Both Windows and Mac also have free online alternatives if you prefer not to install software.
Using online tools to compress without installing software
TinyPNG (tinypng.com) and its sister site TinyJPG compress images in your browser. Upload a photo, the tool compresses it using lossy algorithms optimized for photographs, and you read the result. TinyPNG works on PNG and WebP files; TinyJPG works on JPEG. Both are free for up to 20 images per month. The compression is aggressive — files typically shrink 50 to 80 percent — and the quality loss is usually invisible.
Squoosh (squoosh.app), made by Google, lets you compress in your browser and see a before-and-after comparison side by side. You can choose the format (JPEG, PNG, WebP, or others), adjust quality with a slider, and see the file size change in real time. Squoosh is free with no upload limits and does not store your images on their servers — everything happens in your browser.
The trade-off with online tools is privacy: you are uploading your image to someone else's server. If the image contains sensitive information, use a desktop tool instead. Both TinyPNG and Squoosh are legitimate services run by established companies, but if you work with confidential photos, compress locally on your own computer.
Batch compression for multiple images at once
If you have dozens of photos to compress, doing them one at a time wastes time. Windows users can use the Photos app: open it, select all the images you want to compress (Ctrl+A), right-click, choose "Open with Photos," then use File > Export to save them all with a single quality setting. Mac users can do the same in Preview: open multiple images, select them all in the sidebar, then File > Export applies the same settings to all of them at once.
For more control, use ImageMagick on any operating system. The command mogrify -quality 75 *.jpg compresses all JPEG files in a folder to quality 75 in place. XnConvert (xnview.com) is a free batch converter that works on Windows, Mac, and Linux — you drag a folder of images into it, set the format and quality, and it processes them all automatically.
Online batch tools like CloudConvert (cloudconvert.com) let you upload multiple images at once and read them compressed. The free tier allows a few conversions per day. Batch compression is worth learning if you regularly work with photo libraries or manage a website with many images.
Balancing file size and image quality
The key to good compression is finding the point where the file is small enough for your purpose but the image still looks good. For email and web sharing, a JPEG at quality 75 to 80 is usually the sweet spot — the file is small enough to email or upload quickly, and the quality loss is invisible on a phone or computer screen. For printing or archival, use quality 90 or higher, or use PNG or lossless compression instead.
Test your compression by opening the compressed image on the device where it will be viewed. A photo that looks fine on a phone might look blurry on a large monitor if you compressed it too aggressively. If you are unsure, compress to a higher quality first — you can always recompress to a smaller size later if needed. Recompressing a lossy file multiple times degrades it more each time, so get it right the first time if possible.
For web images, consider the context. A thumbnail or preview image can be compressed heavily because viewers see it small. A hero image at the top of a webpage should be higher quality because it is displayed large. Product photos on an e-commerce site should be high quality so customers can see details, but not so large that the page loads slowly.
Frequently Asked Questions
Can I compress an image without losing quality?
Lossless compression preserves all the original image data, so technically there is no quality loss — you get back exactly what you started with when you decompress it. However, lossless compression shrinks files much less than lossy compression does. For photographs, lossy compression at quality 75 to 80 produces a file one-third the original size with no visible quality loss to the human eye.
What quality setting should I use for JPEG compression?
For web sharing and email, use quality 75 to 80. For printing or images that will be viewed large, use 85 to 90. Quality 100 is lossless and defeats the purpose of JPEG compression. Test on the device where the image will be viewed — what looks fine on a phone might look blurry on a large monitor.
Is it safe to upload my photos to online compression tools?
Legitimate tools like Squoosh and TinyPNG are safe, but they do upload your image to their servers. If the photo contains sensitive information, use a desktop tool instead. Squoosh processes everything in your browser without storing files, which is more private than TinyPNG, which temporarily stores images on their servers.
Why is my compressed image still large?
You may have compressed to a format that does not compress well for that type of image. Photographs compress best as JPEG or WebP; graphics and screenshots compress best as PNG. You may also have set the quality too high. Try lowering the quality setting or switching to a more efficient format like WebP.
Can I undo lossy compression and restore the original image?
No. Lossy compression permanently removes data from the image. Once you save a JPEG at quality 75, the original detail is gone and cannot be recovered. Always keep a backup of the original uncompressed image before you compress it.