Compress JPEG, PNG, and WebP images client-side with target size and dimension controls
Drop an image here or click to browse
JPEG · PNG · WebP · max 10 MB
Original
Compressed
The Image Compressor reduces file sizes for JPEG, PNG, and WebP images entirely in the browser. Drop an image, set a target size in KB and a maximum dimension, choose the output format, and download the compressed result. Before/after size comparison shows exactly how much was saved. Nothing is uploaded to a server.
It’s for developers compressing assets before deploying to a CDN, bloggers optimizing images before uploading to a CMS, and anyone who needs a fast, local compression workflow without installing software or using a web service that receives your files.
Processing uses browser-image-compression, an MIT-licensed library that uses the browser’s Canvas API to resize and re-encode images.
Processing pipeline:
FileReader API — no network requestcanvas.toBlob(callback, mimeType, quality) — the browser’s native encoderBlob is converted to an object URL for preview and downloadWebP vs JPEG vs PNG — when to use each:
| Format | Best for | Lossy? | Typical savings vs JPEG |
|---|---|---|---|
| JPEG | Photos, complex images with gradients | Yes | baseline |
| PNG | Logos, screenshots, text, transparency | No (lossless) | varies |
| WebP | Everything — modern universal format | Both modes | 25–35% vs JPEG |
The quality/size tradeoff: JPEG quality follows a sharply nonlinear curve. Going from quality 100 → 90 may save 50% of file size with negligible visible difference. Going from 90 → 80 may save another 30–40% with minor detail loss visible only at 1:1 zoom in high-frequency areas. Going from 80 → 70 starts producing visible compression artifacts in smooth gradients. The effective sweet spot for most web use cases is quality 75–85.
As a concrete example: a 2 MB screenshot that’s a mix of UI and text typically compresses to 180–250 KB at JPEG quality 80 with no visible quality degradation at normal viewing distances. That’s an 85–90% size reduction that translates directly to faster page loads and lower CDN bandwidth costs.
Format selection is the single highest-leverage decision in image optimization, and most developers default to JPEG for everything without thinking about it.
JPEG is lossy DCT compression. It works by discarding high-frequency spatial information in 8×8 pixel blocks. This makes it excellent for photographs (where the human visual system has low sensitivity to high-frequency detail loss in complex scenes) and poor for screenshots, diagrams, and text (where high-frequency edges — the sharp transitions between UI elements — are exactly what the user is looking at). A screenshot compressed as JPEG at quality 80 will have noticeable blockiness around text. The same screenshot as PNG stays sharp but is larger.
PNG is lossless. Use it for anything with transparency, anything with sharp edges (UI screenshots, diagrams, icons), and anything that will be edited again later. PNG file sizes are determined by pixel count and color complexity — a simple diagram with large flat color areas will compress very well; a photograph will be very large.
WebP is the correct default for web assets. It supports both lossy and lossless modes, handles transparency, and achieves 25–35% smaller files than JPEG at equivalent perceptual quality. Browser support has been universal since 2022. If you’re serving images on the web and not using WebP, you’re shipping unnecessary bandwidth. The only exception is when you need to support extremely old browser versions or email clients (which cannot render WebP).
The Canvas API’s HEIC limitation is relevant for iPhone users. iOS captures photos in HEIC format, which is Apple’s high-efficiency image format. Safari has a native HEIC decoder and can process HEIC files through the Canvas API; Chrome and Firefox do not. For web workflows that start from iPhone photos, converting to JPEG or PNG first (iOS can do this automatically when sharing to non-Apple apps) is the reliable path.
Files are processed entirely in your browser using browser-image-compression, an MIT-licensed library that uses the Canvas API to resize and re-encode images.
Processing pipeline
FileReader API (no upload)imageCompression(file, options) is called with your settingsBlob is converted to an object URL for preview and downloadFor informational purposes only. Not financial, medical, or legal advice. You are solely responsible for how you use these tools.