Compress Images Without Leaving Your Browser
Drop an image above to compress it. The tool defaults to WebP output for the best compression ratio, but you can switch to JPEG or PNG. Adjust the quality slider, compare file sizes side by side, and download the result. Your images are processed locally and never uploaded.
How Lossy Image Compression Works
Lossy compression reduces file size by discarding image data that humans are unlikely to notice. The specific technique varies by format, but the goal is the same: find the information that contributes least to perceived quality and remove it.
JPEG compression (DCT)
JPEG splits the image into 8x8 pixel blocks and applies the Discrete Cosine Transform (DCT) to each block. DCT converts pixel values from spatial data (brightness at each position) into frequency data (how quickly brightness changes across the block). High-frequency components represent fine detail; low-frequency components represent smooth gradients.
The quality slider controls a quantization table that divides each frequency component by a scaling factor. High-frequency components get divided by larger numbers, rounding them toward zero. At 85% quality, most discarded data is high-frequency detail your eye would not resolve at normal viewing distance. At 30%, the quantization is so aggressive that visible blocking artifacts appear.
WebP compression
WebP’s lossy mode uses predictive coding rather than DCT. For each block, the encoder predicts content based on surrounding already-encoded blocks, then stores only the difference (the residual). This residual is transformed, quantized, and entropy-coded.
This is why WebP outperforms JPEG. In large areas of similar color (sky, walls, skin), predictions are accurate, so the residual compresses tightly. JPEG’s block-by-block DCT cannot exploit spatial redundancies across block boundaries.
PNG optimization
PNG is lossless by design, so there is no quality slider. File size depends on the compression filter and deflate settings used during encoding. The practical way to reduce PNG size is to lower the resolution, reduce the color palette, or convert to WebP lossless which achieves roughly 26% smaller files for pixel-perfect quality.
The Quality Slider
The quality value maps to the internal quantization aggressiveness of the encoder. Here is how different ranges behave in practice.
92-100%: Virtually indistinguishable from the original. 2-4x smaller than uncompressed. Use for archival or print.
80-90%: The sweet spot for web images. At 85%, JPEG photographs are 5-10x smaller with no visible difference. WebP at 80% achieves comparable quality at even smaller sizes.
60-79%: Noticeable quality reduction in side-by-side comparison, but acceptable for thumbnails and social media previews.
Below 60%: Visible artifacts. JPEG shows blocking and ringing around edges. WebP shows smearing in detailed areas. Only appropriate for tiny thumbnails or low-bandwidth scenarios.
Practical Workflow for Web Optimization
A web performance workflow for images typically follows this sequence:
-
Resize first. There is no reason to compress a 4000x3000 photo if it will display at 800x600. Resize to the largest dimension you will actually serve (accounting for 2x retina). This alone can cut file size by 80% or more. Use the Image Converter resize controls.
-
Choose the right format. WebP for photographs and complex images. PNG for screenshots, diagrams, and anything with text where lossless quality matters. SVG for icons and logos that need to scale.
-
Set the quality. Start at 85% for JPEG, 80% for WebP. Compare the result to the original at the actual display size (not zoomed in). If it looks identical, try dropping 5% and comparing again. Stop when you first notice degradation, then step back up.
-
Check the file size. A reasonable budget for hero images is 100-200 KB. Card thumbnails should be under 50 KB. Icons and small UI images under 10 KB. If you are over budget after compression, resize the dimensions down.
Typical Savings by Image Type
Photographs (camera shots, product images): JPEG at 85% produces files roughly 90% smaller than uncompressed. WebP at 80% saves another 25-35% on top of equivalent JPEG quality.
Screenshots (UI captures, code editor shots): PNG is already compact because uniform color areas compress well with deflate. WebP lossless saves roughly 26% more. Avoid JPEG for screenshots because DCT artifacts show around text.
Graphics and illustrations (flat color, rasterized vectors): PNG handles these well. WebP lossless does better. JPEG is a poor fit because flat colors expose quantization noise.
Transparent images (logos, icons with alpha): PNG or WebP. JPEG does not support transparency. WebP lossy with alpha produces dramatically smaller files than PNG for soft shadows and anti-aliased edges.
For embedding compressed images directly in HTML or CSS, the Base64 Encoder converts any image file to a data URI. For format conversion without the compression focus, the Image Converter handles all supported formats.