What compression does and why you need it

Image compression makes a photo or graphic file smaller so it loads faster online, takes up less storage space, and moves through email without hitting size limits. Compression works by removing data from the image — either data you won't notice is gone, or data you will. The trade-off between file size and visible quality is the core decision you make when you compress.

Most images you find online are already compressed. A photo straight from your phone or camera is often 5 to 15 megabytes. That same photo compressed for a website might be 200 to 800 kilobytes. The difference is dramatic, but if compression is done right, the image still looks sharp on a screen.

You compress images for different reasons depending on where they're going. A photo for social media can be smaller and lower quality than a photo you're printing. A graphic for a website needs to be smaller than a graphic you're sending to a designer. Understanding what you're compressing for — and what device will display it — helps you choose the right compression level.

Key Takeaways

  • Lossy compression removes data you usually won't see, making files much smaller; lossless compression keeps all the original data but makes smaller files more slowly.
  • JPEG works best for photographs; PNG works best for graphics, logos, and images with text; WebP is newer and smaller but not supported everywhere yet.
  • Most free tools (TinyPNG, Squoosh, or your operating system's built-in options) compress images in seconds without needing software installed.
  • Compressing an image once and saving it is usually enough; compressing the same image multiple times degrades quality each time.
  • The right compression level depends on where the image goes — a thumbnail can be much smaller than a full-width website image or a print file.

Lossy versus lossless compression

Lossy compression throws away data the human eye usually doesn't catch. It removes color information from areas where the eye blends colors together anyway, smooths out tiny variations in tone, and discards detail in shadows or highlights where you're less likely to notice. The result is a much smaller file — often 80 to 90 percent smaller than the original. The trade-off is that if you compress too aggressively, the image starts to look blurry, blocky, or washed out.

Lossless compression keeps every pixel of the original image intact but reorganizes the data so it takes up less space. It's like vacuum-sealing a sweater instead of throwing away threads. The file is smaller, but not as dramatically smaller as lossy compression. Lossless compression is reversible — you can decompress the image and get back exactly what you started with. Lossy compression is not reversible; once data is gone, it's gone.

For photographs, lossy compression is almost always the right choice because photos contain millions of colors and subtle gradations that human eyes blend together. For graphics, logos, screenshots, or images with text, lossless compression is usually better because those images have sharp edges and solid colors that lossy compression can blur or distort.

File formats and when to use each one

JPEG is the standard for photographs. It uses lossy compression, so files are small. A typical photo compresses from 8 megabytes to 300 kilobytes or less. JPEG works on every device and every browser. The downside is that JPEG doesn't handle transparency (you can't have a see-through background), and if you compress a JPEG multiple times, quality degrades each time.

PNG is the standard for graphics, logos, screenshots, and anything with text or sharp edges. It uses lossless compression, so quality never degrades, and it supports transparency. PNG files are larger than JPEG files of the same image, but smaller than the uncompressed original. Use PNG when you need crisp edges or a transparent background.

WebP is a newer format that compresses both photographs and graphics better than JPEG or PNG. A WebP file is often 25 to 35 percent smaller than the equivalent JPEG. The catch is that older browsers and devices don't support WebP yet. If your audience uses older phones or computers, stick with JPEG or PNG. If your audience is mostly on modern devices and you're hosting on a website you control, WebP is worth considering.

GIF is an older format that supports animation and transparency but produces large files. Use GIF only if you need animation; for static images, PNG or JPEG will be smaller.

How to compress on Windows, Mac, or online

You don't need to buy software. Most operating systems have built-in compression, and free online tools work in your browser.

On Windows: Right-click the image file, select "Send to," then "Compressed (zipped) folder." This creates a smaller file, but it's not image compression — it's file compression, and the image quality stays the same. For actual image compression, use an online tool instead.

On Mac: Open the image in Preview (the built-in image viewer). Go to File, then Export. Choose the format (JPEG for photos, PNG for graphics), then use the Quality slider to compress. Lower quality means smaller file size. Click Save.

Online tools that work in your browser: TinyPNG (tinypng.com) handles both PNG and JPEG files. Upload your image, and it compresses automatically. You read the smaller version. Squoosh (squoosh.app) is made by Google and lets you see the quality trade-off in real time — you move a slider and watch the image change as you compress. Both are free and don't require an account.

If you're compressing many images at once, batch tools like ImageMagick (command-line, free) or Adobe Lightroom (paid, with a learning curve) let you compress dozens of files with one command. For most people, one image at a time through an online tool is simpler.

Choosing the right compression level for where the image goes

The right compression depends on context. A thumbnail on a website can be much smaller and lower quality than a full-width hero image. A photo for email can be smaller than a photo for print. A graphic for social media can be smaller than a graphic you're sending to a designer.

For websites: Aim for 100 to 300 kilobytes for a full-width image, 50 to 100 kilobytes for a medium image, and 20 to 50 kilobytes for a thumbnail. Use JPEG for photos, PNG for graphics. Test by uploading the image to your site and viewing it on a phone and a desktop — if it looks sharp on both, the compression is right.

For email: Keep images under 1 megabyte total per message. Compress to 200 to 500 kilobytes per image. Most email clients will display it clearly, and it won't bounce or sit in spam because of size.

For social media: Facebook, Instagram, and Twitter all compress images themselves, so you don't need to compress as aggressively. A JPEG at 500 kilobytes to 1 megabyte is fine. Social platforms will resize it for different devices anyway.

For print: Don't compress. Print needs the full resolution and color data. If you're sending an image to a printer or designer, send the original uncompressed file or ask what format and size they want.

What happens if you compress too much

Over-compressed images look blurry, blocky, or washed out. JPEG compression that's too aggressive creates visible squares or bands of color. PNG compression doesn't degrade quality, but if you convert a PNG to JPEG and then compress heavily, you'll see the damage.

The worst mistake is compressing an image, saving it, then compressing it again. Each time you compress a lossy format like JPEG, you lose more data. After three or four compressions, the image looks noticeably worse. Always compress from the original file, not from a previously compressed version.

If you've already over-compressed and the image looks bad, go back to the original file and compress again with less aggressive settings. There's no way to recover quality from an over-compressed file.

Frequently Asked Questions

Can I compress an image without losing any quality?

Yes, with lossless compression. PNG and GIF use lossless compression, so the image stays exactly the same — you just reorganize the data to take up less space. The file will be smaller than the original, but not as small as lossy compression would make it. For photographs, though, lossy compression is usually the better choice because the file gets much smaller and the quality loss is invisible to the human eye.

What's the difference between compressing an image and resizing it?

Resizing changes the dimensions — a 4000-pixel-wide photo becomes 1000 pixels wide. Compression keeps the dimensions the same but removes data to make the file smaller. Both make files smaller, but they do it different ways. For web use, you usually do both: resize to the width you need, then compress.

Why does my compressed image look blurry on my phone?

Your phone might be displaying it at a larger size than you compressed it for. If you compressed a photo to 500 pixels wide but your phone displays it at 800 pixels wide, the phone stretches it and it looks blurry. Compress to the actual size you need, or compress less aggressively so there's more detail to work with if the image gets enlarged.

Is WebP worth using if most people still use older devices?

Not yet. If your audience includes people on older phones or computers, stick with JPEG or PNG. WebP is worth using only if you know your audience is on modern devices, or if you're willing to serve JPEG to older browsers and WebP to newer ones — which requires extra setup. For most small projects, JPEG and PNG are simpler and more reliable.

How do I know if I've compressed enough?

read the compressed image and view it on the device where it will actually be seen — a phone for social media, a desktop for a website, a printer for print. If it looks sharp and the file size is reasonable for where it's going, you've compressed enough. If it looks blurry or pixelated, decompress and try again with less aggressive settings.