ToolsAtZero

How to Compress Images

6 min readbeginnerJune 2026

Quick Answer

To compress images, upload your JPEG or PNG files to a client-side compressor, set quality to 80-85% for JPEG, strip EXIF metadata for privacy, and download the smaller files. All processing happens in your browser — no photos are uploaded to any server. Typical savings: 50-80% file size reduction.

Optimizing website speed requires compressed images. This tutorial explains how to downsize JPEG and PNG bytes directly in-browser while preserving visual quality, and covers the science behind different compression techniques.

Why It Matters

Images account for 50-70% of total web page weight on average. Uncompressed photos increase load times, hurt SEO rankings, and consume mobile users' data plans. Proper compression delivers identical visual results at a fraction of the bandwidth cost.

Table of Contents

  • The Math Behind Image Compression
  • Steps to Compress Photos Locally
  • Best Practices for Web Images
  • EXIF Data and Privacy
  • Troubleshooting Common Issues
  • Performance Optimization
  • Frequently Asked Questions

Step-by-Step Instructions

  1. Navigate to the Free Image Compressor page.
  2. Upload or drop your JPEG or PNG files into the compressor grid.
  3. Adjust the target quality slider (80-85% is recommended for web).
  4. Toggle EXIF metadata stripping to clean camera profile details.
  5. Review the dynamic file size savings and save the compressed images.

How It Works

The browser reads the image file into memory and decodes it onto an invisible HTML Canvas element at the original resolution. For JPEG output, the Canvas API's toBlob() method re-encodes the pixel data using the specified quality factor — lower quality means more aggressive DCT quantization and smaller files. For PNG, the lossless DEFLATE algorithm compresses the raw pixel data without discarding information. EXIF stripping works by reading only the image bitmap and discarding the metadata headers entirely during re-encoding.

Examples

  • Compressing product photos from 4 MB to 400 KB for faster e-commerce page loads
  • Stripping GPS coordinates from vacation photos before posting on social media
  • Batch-compressing blog header images to meet a 200 KB per-image budget
  • Reducing screenshot file sizes from 2 MB PNG to 300 KB JPEG for documentation
  • Optimizing portfolio photographs for a photography website without visible quality loss

Best Practices

  • Strip EXIF geolocation headers to protect your privacy before posting images online.
  • Use JPEG for photos and PNG for charts or transparent graphics.
  • Resize pixel width to match target layout displays before compressing.
  • Keep one uncompressed original as a master copy — never compress from an already-compressed file.
  • Test compressed images on both retina and standard displays to ensure acceptable quality.

Common Mistakes

  • Compressing files repeatedly, which causes progressive lossy pixel degradation.
  • Uploading private camera rolls to remote servers.
  • Using lossless compression on large photos when lossy JPEG is more suited.
  • Setting JPEG quality below 60%, which introduces visible block artifacts.
  • Ignoring image dimensions — compressing a 6000px-wide photo to 80% quality still results in a large file.

Pro Tips

  • Quality 82 for JPEG hits the sweet spot — diminishing returns above 85, visible artifacts below 70.
  • Use the 'Save for Web' mental model: resize first, then compress, then strip metadata.
  • For transparent images that must stay transparent, compress as PNG with optimized DEFLATE — do not convert to JPEG.
  • Consider WebP output if your audience uses modern browsers — 25-35% smaller than equivalent JPEG.
  • Automate batch compression with a build tool (e.g., imagemin in webpack) for production workflows.

Troubleshooting

The compressed image looks blurry.

Quality is set too low. Increase the quality slider to 80-85% for JPEG. If the image is a screenshot or diagram, use PNG instead.

File size barely changed after compression.

The image was likely already compressed. Also check if the dimensions are very large — resize to the actual display width first, then compress.

Colors look different after compression.

JPEG compression can shift colors slightly due to chroma subsampling. For color-critical work (product photos, art), use quality 90+ or lossless PNG.

Transparent background turned white.

You output as JPEG, which does not support transparency. Use PNG output to preserve alpha channel transparency.

EXIF stripping didn't remove all metadata.

Some metadata (XMP, IPTC) is stored in separate blocks from EXIF. Ensure the tool strips all metadata types, not just EXIF.

Browser freezes when compressing many images.

Process images sequentially or in small batches. Tools using Web Workers offload decoding to background threads to prevent UI freezing.

Compressed PNG is larger than the original.

This can happen if the original used a highly optimized encoder. The browser's built-in PNG encoder is not as aggressive — try a dedicated PNG optimizer like oxipng.

The tool doesn't accept my image format.

Browser-based compressors typically support JPEG, PNG, and WebP. Convert BMP, TIFF, or HEIC files to a supported format first.

Benefits

  • Faster page loads — compressed images directly reduce Time to Interactive (TTI) and Largest Contentful Paint (LCP)
  • Privacy preserved — photos stay on your device, EXIF location data is stripped locally
  • Bandwidth savings — 50-80% file size reduction means lower hosting costs and faster mobile experiences
  • SEO improvement — Google's Core Web Vitals reward pages with optimized image weights
  • No quality loss at recommended settings — 80-85% JPEG quality is perceptually identical to the original

Limitations

  • JPEG compression is lossy — each re-compression cycle degrades quality further (generation loss)
  • Browser PNG encoders are less aggressive than specialized tools like oxipng or zopflipng
  • Very large images (10,000+ px) may exceed Canvas element size limits in some browsers
  • HEIC and RAW formats require conversion before browser-based compression
  • No AI-powered upscaling — compression reduces file size, it does not enhance resolution
Security & Privacy
  • All compression runs locally via the Canvas API — no image data is transmitted to servers
  • EXIF stripping removes GPS coordinates, camera serial numbers, and timestamps that could identify your location and device
  • Compressed output contains only pixel data — no hidden metadata is re-injected by the tool
  • For maximum assurance with sensitive photos, disconnect from the internet before processing

Performance Tips

  • Resize images to the maximum display width before compressing — a 1200px-wide blog column does not need a 6000px-wide source image
  • Process images one at a time in memory-constrained environments (phones, tablets with < 3 GB RAM)
  • Use WebP output when possible — it compresses faster and produces smaller files than JPEG
  • Enable OffscreenCanvas in Web Workers for true background processing without blocking the main thread
  • For batch workflows, sort images by file size and process the largest first to catch memory issues early

Industry Use Cases

  • E-commerce: Compressing product catalog images to reduce page load time and improve conversion rates
  • Blogging: Optimizing featured images and inline photos to stay within hosting bandwidth limits
  • Social media: Stripping EXIF location data from personal photos before uploading to public platforms
  • Email marketing: Reducing inline image sizes to keep total email weight under 1 MB for deliverability
  • Web development: Automating image optimization as part of a CI/CD build pipeline
  • Photography: Creating web-resolution portfolio galleries from high-resolution masters

Frequently Asked Questions

Q: Does stripping metadata reduce image resolution?

No. Metadata is only text data (camera type, location). Stripping it saves file bytes without changing image pixels.

Q: What is the best format for web graphics?

WebP or compressed JPEGs are standard. PNG is best for logos with transparency.

Q: What is lossy compression?

Lossy compression permanently removes data that humans cannot easily perceive. JPEG uses this approach — the decoded image is not bit-identical to the original.

Q: What is lossless compression?

Lossless compression encodes data more efficiently without removing any information. PNG DEFLATE is lossless — the decoded pixels are identical to the original.

Q: What is EXIF metadata?

EXIF (Exchangeable Image File Format) is a standard for storing camera settings, GPS coordinates, timestamps, and device information within image files.

Q: What quality setting should I use?

For JPEG, 80-85% offers the best balance. Below 70% introduces visible artifacts. Above 90% yields diminishing size savings.

Q: Who needs image compression most?

Web developers, bloggers, e-commerce managers, and anyone publishing images online. Mobile-first sites benefit the most due to bandwidth constraints.

Q: When should I use PNG instead of JPEG?

Use PNG for images requiring transparency, sharp text overlays, screenshots, diagrams, or graphics with fewer than 256 colors.

Q: When does compression become visible?

JPEG artifacts become noticeable below quality 65-70% — blocky patterns appear, especially around sharp edges and text.

Q: Where does compression happen in the browser?

The image is decoded onto an HTML Canvas, then re-encoded using canvas.toBlob() with the specified MIME type and quality parameter.

Q: Why do images look fine on my screen but blurry on retina displays?

Retina screens have 2-3x pixel density. Serve images at 2x the CSS display width, then let the browser scale them down for sharp rendering.

Q: Why is my PNG file so much larger than the JPEG version?

PNG is lossless and stores every pixel exactly. JPEG discards imperceptible details. For photographs, JPEG is typically 5-10x smaller than PNG.

Q: How does JPEG compression work?

JPEG splits the image into 8×8 pixel blocks, applies Discrete Cosine Transform to convert spatial data to frequency data, then quantizes high-frequency components based on the quality setting.

Q: How much file size reduction can I expect?

Typical JPEG compression at 80% quality reduces file size by 60-80%. PNG optimization yields 10-30% savings depending on image complexity.

Q: How do I compress images in bulk?

Use a batch compressor that queues images and processes them sequentially or in parallel using Web Workers.

Q: Can I compress an image without losing quality?

Yes, using lossless formats (PNG, lossless WebP). For JPEG, quality 90-95% is perceptually lossless but still reduces file size by 20-40%.

Q: Can compressed images be uncompressed back to original quality?

No. Lossy JPEG compression permanently discards data. Always keep an uncompressed master copy.

Q: Can I compress GIF files the same way?

GIFs use a different compression (LZW) and are palette-based. Use a dedicated GIF optimizer, or convert to WebP for animated content.

Q: Should I compress images before uploading to social media?

Yes, primarily to strip EXIF location data. Social platforms re-compress uploads anyway, but stripping metadata protects your privacy.

Q: Should I use WebP instead of JPEG?

WebP offers 25-35% better compression at equivalent quality and supports transparency. Use it if your audience uses modern browsers (95%+ global support).

Q: Is browser-based compression as good as Photoshop?

For standard web optimization, yes. Photoshop offers more granular control (chroma subsampling, progressive encoding), but browser tools handle 90% of use cases effectively.

Q: Is it safe to compress medical or legal images?

Use lossless compression only for images where accuracy is critical (medical scans, legal evidence). Lossy compression could remove diagnostically relevant details.

Q: Does compression affect image dimensions?

No. Compression reduces file size by encoding pixel data more efficiently. Pixel dimensions remain unchanged unless you explicitly resize.

Q: Does the compressor work on mobile browsers?

Yes. The Canvas API works on all modern mobile browsers. Processing speed depends on device CPU and available memory.

Q: Does compressing a screenshot affect text readability?

JPEG compression can blur sharp text edges. For screenshots with text, use PNG or set JPEG quality to 90%+.

Q: What is chroma subsampling?

A technique where color information is stored at lower resolution than brightness. JPEG uses 4:2:0 subsampling by default, saving ~33% with minimal visible impact.

Q: What is progressive JPEG?

A JPEG encoding mode where the image loads in multiple passes from blurry to sharp, improving perceived performance on slow connections.

Q: How do I check if my images are already compressed?

Compare the file size to expected values: a 1920×1080 JPEG photo should be 200-500 KB at typical quality. If it's under that, it's likely already compressed.

Q: What is the maximum image size a browser can handle?

Most browsers limit Canvas to about 16,384 × 16,384 pixels (268 megapixels). Images exceeding this must be resized before processing.

Q: Can I set different quality levels for different images?

Yes. Process each image individually with its own quality slider setting, or use a batch tool that allows per-file quality overrides.

People Also Ask

How do I convert PNG to JPG?

Use a browser-based converter that renders the PNG onto a Canvas and re-encodes it as JPEG, replacing transparency with a solid background color.

What is the best image format for websites in 2025?

WebP for photographs and general images, SVG for icons and logos, PNG for images requiring transparency with sharp edges.

How do I remove EXIF data from photos?

Use an image compressor or metadata stripper that re-encodes the image without the EXIF headers — or simply compress the image through the Canvas API.

Does Google penalize uncompressed images?

Yes, indirectly. Uncompressed images slow page load times, worsening Core Web Vitals scores (LCP), which impacts search rankings.

How do I compress images for email attachments?

Resize to 1200px wide and compress to JPEG quality 80%. This typically brings photos under 200 KB while maintaining readability.

What is the difference between image compression and resizing?

Compression reduces file size by encoding pixels more efficiently (or discarding imperceptible data). Resizing changes the actual pixel dimensions of the image.

Can I batch-optimize images for WordPress?

Yes, compress images before uploading, or use a WordPress plugin that optimizes on upload. Client-side tools let you process before the upload step.

What is WebP and should I use it?

WebP is a modern image format by Google that supports both lossy and lossless compression with 25-35% better efficiency than JPEG/PNG. Use it for web delivery.

How do I check image compression quality?

Compare side-by-side at 100% zoom. For automated checks, use SSIM (Structural Similarity Index) — values above 0.95 indicate perceptually identical results.

Are there image formats better than WebP?

AVIF offers 20% better compression than WebP but has slower encoding and less browser support. JPEG XL is promising but not widely supported yet.

Glossary

JPEG (Joint Photographic Experts Group)A lossy image compression standard optimized for continuous-tone photographs, using DCT-based frequency quantization.
PNG (Portable Network Graphics)A lossless raster image format supporting transparency (alpha channel) and DEFLATE compression.
EXIF (Exchangeable Image File Format)A metadata standard embedded in image files containing camera settings, GPS coordinates, timestamps, and device information.
DCT (Discrete Cosine Transform)A mathematical transformation used in JPEG compression to convert spatial pixel data into frequency coefficients for quantization.
QuantizationThe lossy step in JPEG compression where high-frequency DCT coefficients are rounded, reducing precision to decrease file size.
Canvas APIA browser API for drawing and manipulating raster images in JavaScript. Used by compressors to decode, process, and re-encode images.
WebPA modern image format developed by Google supporting both lossy and lossless compression, with 25-35% better efficiency than JPEG.
Chroma subsamplingA technique that encodes color information at lower resolution than luminance, exploiting human vision's lower sensitivity to color detail.
LCP (Largest Contentful Paint)A Core Web Vitals metric measuring how long it takes for the largest visible content element (often an image) to render on screen.
Alpha channelAn additional data layer in image formats (PNG, WebP) that defines per-pixel transparency levels from fully opaque to fully transparent.

Conclusion

Image compression is essential for web performance, privacy, and bandwidth efficiency. By using a client-side compressor at 80-85% JPEG quality and stripping EXIF metadata, you achieve 50-80% file size reduction without visible quality loss and without exposing your photos to third-party servers.

Key Takeaways

  • Lossy JPEG compression at 80-85% quality is usually indistinguishable from the original to human eyes
  • Stripping EXIF metadata removes GPS coordinates and camera details — critical for privacy
  • Resize images to the display resolution before compressing to maximize savings
  • PNG is lossless and best for graphics with sharp edges; JPEG is lossy and best for photographs
  • Client-side compression avoids uploading personal photos to third-party servers