How to Compress an Image: Methods, Formats, and What Actually Changes

Compressing an image sounds straightforward — make the file smaller. But what actually happens during compression, which method you should use, and how much quality you'll lose along the way all depend on factors that vary significantly from one situation to the next.

Here's what you need to understand before you touch a single file.

What Image Compression Actually Does

When you compress an image, you're reducing the amount of data needed to store or transmit it. There are two fundamental approaches:

Lossless compression removes redundant data without discarding any visual information. The image can be perfectly reconstructed from the compressed file. File size reduction is more modest — typically 10–30% depending on image content.

Lossy compression permanently discards some visual data to achieve much larger reductions — often 60–80% or more. The trade-off is a measurable drop in quality, though at moderate compression levels the difference may be imperceptible to the human eye.

Most everyday image compression uses lossy methods, particularly for photos. Lossless compression is more common for graphics, logos, and images with text where sharpness matters more than file size.

The Format Question Changes Everything 🖼️

The file format you're working with — or choosing to export to — has a major impact on how compression behaves.

FormatCompression TypeBest ForTransparency Support
JPEGLossyPhotos, complex imagesNo
PNGLosslessGraphics, screenshots, logosYes
WebPBothWeb images (photos + graphics)Yes
AVIFBothWeb images, high efficiencyYes
GIFLossless (limited)Simple animationsYes (1-bit)
TIFFLosslessPrint, archivingYes

Converting a PNG to JPEG will reduce file size dramatically but introduces lossy compression for the first time. Converting a JPEG to WebP at equivalent quality typically produces a smaller file without additional visible quality loss. Choosing the wrong format for the job — like saving a logo as JPEG — can actually make results worse despite a smaller file size.

How to Actually Compress an Image

The right method depends on your operating system, technical comfort level, and what you're compressing images for.

Built-in OS Tools

On Windows, Paint and Photos both allow basic resizing and quality adjustment on export. Neither offers fine-grained compression control, but they handle quick tasks without installing anything.

On macOS, Preview gives you direct access to export quality sliders and format conversion. You can batch-process multiple files using Automator. The "Export as" option under the File menu is where compression controls live.

On iPhone/iPad and Android, the built-in Photos and Gallery apps apply their own compression automatically when you share or export. Third-party apps give you more control over quality levels and output format.

Desktop Software

Applications like Adobe Photoshop and GIMP (free) offer granular compression settings. When exporting, you can adjust quality level (typically 0–100 in JPEG terms), preview the result before saving, and compare file sizes in real time. This level of control is useful when you need a specific file size or are preparing images for a particular platform.

Lightroom and similar photo management tools apply compression during export and can batch-process entire libraries with consistent settings.

Web-Based Tools

Browser-based compressors — where you upload an image, choose a quality level, and download the result — require no software installation. They vary in the formats they support, how much control they give you, and whether they process files locally in your browser or send them to a server. Privacy matters here if you're compressing sensitive images.

Command-Line Tools

Tools like ImageMagick, libvips, and format-specific utilities (jpegoptim, pngquant, cwebp) allow precise, scriptable compression — useful for developers processing large batches or integrating compression into automated workflows.

The Variables That Determine Your Results 📊

Compression outcomes aren't uniform. Several factors shape what you'll actually get:

Image content — A photo of a forest compresses differently than a flat-color graphic. Lossy compression artifacts are more visible in images with sharp edges, text, or uniform color fields.

Starting file quality — Re-compressing an already-compressed JPEG compounds quality loss. Each round of lossy compression is additive damage.

Target use case — Web images have different requirements than print files, email attachments, or archival storage. A web image optimized to 150KB may be perfectly usable at screen resolution but unusable for print.

Dimensions vs. compression — Reducing image dimensions (pixel width and height) often has a bigger impact on file size than adjusting compression quality alone. A 6000×4000 photo resized to 1200×800 will be dramatically smaller before any compression is applied.

Quality setting precision — The difference between JPEG quality 80 and quality 85 is subtle visually but noticeable in file size. Quality 60 vs quality 40 becomes visible in artifacts around edges and gradients.

What "Good" Compression Looks Like in Practice

There's no universal target. Web performance guidelines often suggest keeping images under 200KB for above-the-fold content, but that's a general benchmark, not a rule that applies to every situation. A product photograph on an e-commerce site, an avatar thumbnail, and a hero banner image all have different size and quality requirements.

For most web use, JPEG or WebP at quality settings between 75–85 represents a reasonable balance between file size and visible quality — but that range shifts based on image content, display size, and audience tolerance for compression artifacts.

The right compression level for a background image on a landing page is different from the right level for a printable event flyer or a medical image that needs diagnostic clarity.

The Part That Depends on Your Situation 🎯

Understanding compression methods, formats, and quality trade-offs gets you most of the way there. But the specific combination that makes sense — which tool, which format, which quality level, whether to prioritize size or fidelity — comes down to what you're actually trying to do with the image and where it's going. That context is the variable no general guide can fill in for you.